The type 'System.Xml.IXmlLineInfo' is defined in an assembly that is not referenced

Topics: Troubleshooting
Feb 8, 2014 at 9:59 PM
Edited Feb 8, 2014 at 10:20 PM
Dear all,

I'm currently having a heavy fight with the attempt to overwrite the RemoteRSS.cshtml, usually provided within Vandelay.Industries Remote RSS.

Here's my error message:
Compilation Error 
 Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

 Compiler Error Message: CS0012: 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=b77a5c561934e089'.

Source Error:
Line 1:  @using System.Xml.Linq
Line 2:  @{
Line 3:      var feed = Model.Feed as XElement;
Line 4:  }
Line 5:  <ul class="content-items icons-ul">
The strange thing is, I am referencing the System.Xml and System.XML.Linq of course. My Visual Studio is also not having any issues at all.

As a proof for the reference, here's a part out of the solution file:
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.ComponentModel.DataAnnotations">
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Abstractions" />
    <Reference Include="System.Web.Routing" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Xml.Linq" />
I have .Net Framework 4.0 set as my target version, as it's the same for Vandelay Industries.

Do you guys have any idea?


Apr 23, 2014 at 12:18 PM
Edited Apr 23, 2014 at 12:19 PM
Hi SantoDE,

I had the same problem... Tbh i can't explain why, but it has been fixed when i set my reference copy to local.
Right click on the "System.Xml" and "System.Xml.Linq" --> Properties and set Copy Local to "True"

Best Regards
Nov 14, 2014 at 4:30 PM
add references to your /Modules/Vandelay.Industries/web.config
<add assembly="System.Xml, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

and to your /Modules/Vandelay.Industries/Views/Parts/ RemoteRss.cshtml

@using System.Xml.Linq
@using System.Xml
var feed = Model.Feed as XElement;

then it works.