Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes a "Cannot resolve dependency error" from MsBuild?

I'm trying to set up some build scripts for continuous integration and I'm finding something weird.

My solution compiles fine from Visual Studio 2010, but fails with an error when I build the exact same thing from the command line with MSBuild.

Here's the error I get from the commandline build.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.WinFX.targets(269,9):
error MC1000: Unknown build error,
'Cannot resolve dependency to assembly 'Microsoft.Windows.Design.Extensibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'
[C:\Dev\Market Watch\src\Console\MarketWatch.Console\Rbnz.MarketWatch.Console.csproj]

I've checked through all my source code for references to Microsoft.Windows.Design.Extensibility and haven't found any at all. I've also checked all the binaries we reference from this project, including some DevExpress libraries.

My MSBuild commandline looks like this:

MsBuild.exe c:\Dev\MarketWatch\src\Capture\Capture.sln 
  /t:rebuild 
  /verbosity:quiet 
  /filelogger 
  /fileloggerparameters:LogFile=c:\Dev\MarketWatch\build\Logs\capture.msbuild.log

Is there something missing that I should include on the MsBuild commandline to make commandline builds work just the same as those run by Visual Studio?

Update 14/4

  • I'm getting these errors despite running the build script from a Visual Studio command prompt.
like image 625
Bevan Avatar asked Apr 13 '11 03:04

Bevan


1 Answers

I hope you solved the problem, but for future reference:

I just had the same problem, and it comes from DevExpress '.design' assemblies. You're actually not supposed to reference those in your project. Remove all references to DevExpress assemblies ending with '.design' and it should work.

like image 143
Kevin Gosse Avatar answered Oct 02 '22 11:10

Kevin Gosse