开发者

MSBuild from command line errors - Reference required to System.Xml

开发者 https://www.devze.com 2023-01-23 11:13 出处:网络
I\'m creating a batch script which will get latest version of the code of an application, then build it using msbuild. Everything works until the msbuild part. Here\'s the line that runs msbuild:

I'm creating a batch script which will get latest version of the code of an application, then build it using msbuild. Everything works until the msbuild part. Here's the line that runs msbuild:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe "code/Solution.sln" /p:Configuration="Debug"

And the thing errors al开发者_StackOverflowl over the place - all the errors say something like:

C:\code\project1\codefile1.vb(882): error BC30009: Reference required to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the implemented interface 'System.Xml.Serialization.IXmlSerializable'. Add one to your project.

Everything builds without errors from from Visual Studio 2008. What's going on here?


This is probably most detailed descriptions on what is going wrong:

MSBuild Can't Find Secondary References

Resolving Binary References in MSBuild

In short: Your project references assembly X. X contains a class, that implements interface from assembly Y. Your project does not reference Y, so MSBuild fails. Studio acts a bit smarter and finds the second level reference.


Do just what it says and add a reference to System.Xml to your project.

Project->Add Reference

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号