DylanSmith

We have a project that we are trying build from MSBuild. If we build it in VS IDE it works fine but when we try to build it from MSBuild on the command-line it throws the following error:

error BC30009: Reference required to assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the implemented interface 'System.Runtime.Serialization.IExtensibleDataObject'. Add one to your project.

It throws this error 84 times, on almost every line of code it seems even though we are not doing anything explicit with serialization. The project contains file references to a bunch of custom DLL's which exist in the proper path, and then these 3 ref's:

<Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />

I'm assuming that System.Runtime.Serialization is part of the System assembly. But what's confusing is that MSBuild seems to be looking for version 3.0 for some reason when the reference is for 2.0. I've tried uninstalling the .Net 3.0 framework off the machine and we still get the same error. When I try compiling it using devenv from the command-line it throws the same errors, but from within the IDE it compiles fine.

Any idea what's going on here I'm stumped...



Re: Visual Studio MSBuild VS IDE builds fine, MSBuild throws reference required errors

Jerel Frauenheim - MSFT

A couple questions here:


Assuming that you are using VS 2005 on Vista If not, what OS and version of Visual Studio are you running If VS 2005, do you have SP1 installed The update for Vista if you are running on Vista

It could be something as simple as the command prompt does not have the Microsoft.Net/Framework/v3.0 path in the common path or it could be more interesting. How are you calling msbuild From a Visual Studio command path (That has run vcvars32.bat) or something else

Jerel Frauenheim | Visual Studio - MSBuild

This posting is provided "AS IS" with no warranties, and confers no rights.





Re: Visual Studio MSBuild VS IDE builds fine, MSBuild throws reference required errors

DanMoseley - MSFT

Hi,

Please get a diagnostic log of building this project (see instructions at the top of the forum) and share the part relating to "ResolveAssemblyReferences". That should help.

Dan