Mar 4, 2011

The type 'System.Xml.IXmlLineInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'

Mar 4, 2011

I have been getting this weird exception out of nowhere while compiling my solution. Turns out I had two projects in my solution using different System.Xml assembly. One using straight from .NET Framework 2.0 and other using assembly ( from Silverlight runtime).

Referenced path were
C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll respectively.

If a project file does not specify the exact reference assembly, compiler tries to use any matching assembly present in its cache. I could see the following reference in my csproj file.
<Reference Include="System.Xml"/>

I updated this reference with the correct version (along with the PublicKeyToken and Culture info) and made the SpecificVersion=True, enforcing compiler to use the specified assembly

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

This resolved my problem. Specifying strong references in project files will eliminate issues caused by same name assemblies.


Top Ad 728x90