MsBuild from command line does not generate FakeAssemblies

I have a test project in my solution that uses fakes for testing and I pretend that one of my DLLs in another project is in the same solution.

When I build the solution in VS2013 everything works well and I can see that the FakesAssemblies folder is being created with fakes for my dll.

But if I use msbuild from the command line, I don't see that the FakesAssemblies folder is being created and my test project fails because the referenced dll was not found.

Log from MSBuild:

(ResolveAssemblyReferences target) -> C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Microsoft.Common.targets (1605.5): MSB3245 warning: Could not resolve this link. Could not find assembly "CustomNetworkLib.Fakes". Make sure the assembly exists on disk. If this link is required for your code, you may get compilation errors.
....
FakeNetworkHelper.cs (1.28): error CS0234: The type or namespace name "Fakes" does not exist in the namespace "CustomNetworkLib.Binding" (are you missing an assembly reference?)

Thanks for any help ...

+3


source to share


1 answer


I got an answer.

We need to use MsBuild version 12 from the following location "C: \ Program Files (x86) \ MSBuild \ 12.0 \ Bin \ MSBuild.exe"



It has the ability to create fake DLLs .. and I think it gets installed along with VS.

I actually used msbuild from .. C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe

+4


source







All Articles