views:

58

answers:

1

I have a visual studio 2010 project that is trageted to .Net Framework 3.5. The project build fine from the Visual Studio but when I try to compile it from command line or from TeamCity I get the following build error:

C:\Windows\Microsoft.NET\Framework\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, PublicKey Token=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:\Work\MyProject\MyProject.sln]

The builder seems to complain about Microsoft.Windows.Design.Extensibility.dll but The project do not depend on this library.

+1  A: 

It is bombing trying to compile the XAML in the project. Ignore the remark about ReflectionOnlyAssemblyResolve event in the message, that's just it trying to be helpful to solve the problem. The real issue is that it simply cannot find the assembly.

That's to be expected, Microsoft.Windows.Design.Extensibility is a Visual Studio assembly, stored in the Common7\IDE\PublicAssemblies folder. It could only be found if that folder is in the probing path, it surely won't be if you run msbuild.exe from a build tool.

Not sure what to recommend, you'll have to find out where that dependency comes from. That probably ought to start at the .xaml file content, search for the assembly name. Also verify that the problem reproduces when you run msbuild.exe from the Visual Studio Command Prompt.

Hans Passant
It seems that the dependency comes from a third party library. It Tried to add the reference to the library from the location you advised me and it worked fine. Thank you.
AmineK