3
votes

I am trying to compile a .NET 3.5 solution with MSBuild (version 3.5 ofc), but it fails on compiling unit tests files.

C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.SmartDevice.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Some additional info: - Everything (compilation and testrun) works fine when I compile it with Visual Studio 2008. - I am sure this dll exists in Public (or private) Assemblies folder. - Some projects in this solution are destined for .NET 3.5 Compact Framework. May this be a cause of this problem?

Regards,

EDIT: I have found a workaround for this issue.I have simply added "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies" reference path to my MSBuild script and it works now. However - I still feel there should be a better way.

I am using C#.

1
Are you using C# or VB? I don't know how to show you in VB.jp2code

1 Answers

0
votes

Solution by Pawel Wrobel (which helped me out):

EDIT: I have found a workaround for this issue.I have simply added "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies" reference path to my MSBuild script and it works now. However - I still feel there should be a better way.

You have to pass the argument like this:

msbuild.exe /p:ReferencePath="C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\Common7\IDE\PublicAssemblies"