-
-
Notifications
You must be signed in to change notification settings - Fork 813
Linux compilation fails using Mono on Moq 4.8+ #864
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
Comments
What is the targeted framework? |
Our project is targeting .NET 4.6.1. |
I am fairly confident that this will turn out to be either a Mono tooling issue or, even more likely, a problem with your project configuration/setup. I'll still take a look at it, but in order to do so, please post or link to a minimal code repo that I can build using Mono to repro the error. Or, provide precise and complete repro instructions. (Above, you first suggested that you call the compiler directly; your second post hinted at the existence of a project, i.e. MSBuild. A repo would clear things up a lot, otherwise I just have to guess.) Without a repro, I'll close this issue in a few days' time. |
Thanks for the response. Here's a link to a minimal code repo: I can reproduce the error with the command "mcs test.cs -r:Moq.dll" Let me know if this is enough for you to reproduce. |
OK, I could reproduce this using the I tried two things, both of which made that compilation error you reported go away:
Note that newer versions of Mono now ship with the Roslyn C# compiler (i.e. I'm closing this issue, since the two suggestions above both result in successful compilation. Please do let us know whether this helped you. |
Great, thanks for the help. We'll be looking into switching our project over to use the Roslyn C# compiler. |
Hi there, I'm not sure if this would be a Moq or a Mono issue, but thought I'd post here just in case. Compilation is failing on Linux while trying to reference Moq.dll with Mono. The issue first arises in 4.8.0-rc1 and is still present in 4.12.0.
Linux Version: Red Hat 6.5 (Santiago)
Mono Versions Tested: 5.14 and 6.0.0
Assembly Versions:
Compiling a C# HelloWorld program with an added 'using Moq;' statement fails with the following error message:
-> mcs Program.cs -r:Moq.dll
-> error CS0009: Metadata file '/project/Moq.dll' does not contain valid metadata
In fact, the program doesn't need to have the 'using Moq;' statement for compilation to fail, the '-r:Moq.dll' in the mcs command is enough to generate this error message. I have also tried referencing all the Moq dependencies but I get the same error message. Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: