Diptesh Patil
Diptesh Patil

Reputation: 133

MsBuild from command prompt is not generating the FakeAssemblies

I have a test project in my solution which uses fakes for testing, and I am faking one of my dll build in other project in the same solution.

When i build the solution in VS2013 everything works well and i see that FakesAssemblies folder is create with the fakes for my dll.

But if i use the msbuild from command prompt i dont see that FakesAssemblies folder is create and my test project fails with reference dll not found.

Log from MSBuild:

(ResolveAssemblyReferences target) -> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "CustomNetworkLib.Fakes". Check to make sure the assembly exists on disk. If this reference is required by 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...

Upvotes: 3

Views: 1924

Answers (1)

Diptesh Patil
Diptesh Patil

Reputation: 133

I got the answer..

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

This has the ability to create the fakes dlls.. and i think it gets installed along with the VS.

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

Upvotes: 4

Related Questions