Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does moq have dependency on moq.resources? #344

Closed
Ray1988 opened this issue May 17, 2017 · 7 comments
Closed

Does moq have dependency on moq.resources? #344

Ray1988 opened this issue May 17, 2017 · 7 comments

Comments

@Ray1988
Copy link

Ray1988 commented May 17, 2017

System.IO.FileNotFoundException: Could not load file or assembly 'Moq.resources, Version=4.2.1510.2205, Culture=en-US, PublicKeyToken=69f491c39445e920' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'file:///E:\repo*******\Moq.resources.dll' or one of its dependencies. The system cannot find the file specified.Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll

@kzu
Copy link
Contributor

kzu commented May 17, 2017

Repro?

@Ray1988
Copy link
Author

Ray1988 commented May 17, 2017

Such issue only happened when I try to verify something like below, if I remove all of the verify statement, this issue will disappear

    sqlMock.Verify(framework => framework.SafeOpen(expectedConnecionString), Times.AtMostOnce);
        sqlMock.Verify(
            framework =>
                framework.ExecuteScalarAsync(
                    It.IsAny<SqlConnection>(),
                    It.Is<SqlCommand>(c => this.IsSameSqlCommand(c, expectedCmd)), null, CancellationToken.None),
                    Times.AtMostOnce);

@Ray1988 Ray1988 changed the title Does moq has dependency on moq.resources? Does moq have dependency on moq.resources? May 17, 2017
@kzu
Copy link
Contributor

kzu commented May 18, 2017 via email

@Ray1988
Copy link
Author

Ray1988 commented May 18, 2017

During test run

@kzu
Copy link
Contributor

kzu commented May 18, 2017 via email

@stakx
Copy link
Contributor

stakx commented Jun 5, 2017

Moq.resources isn't a standalone DLL, but a resource embedded in Moq.dll. .NET tries to load it when a resource gets requested via ResourceManager. You can observe this if you register a custom AppDomain.AssemblyResolve handler. (Btw., have you by chance done this?)

I agree that all of this is guesswork without some repro code. ;-)

@stakx
Copy link
Contributor

stakx commented Jun 15, 2017

I am closing this issue for now, since no code for reproducing this issue has been provided. @Ray1988, if you still want us to look into this, report back with some repro code and we can reopen the issue.

@stakx stakx closed this as completed Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants