简体   繁体   中英

Adding a reference to C# project it's immediately invalid

I'm trying to add a reference to a C# class library project. It's immediately shown as invalid in Solution Explorer. The project is targeting .NET framework 4.5.

In order to add the reference, I'm right clicking on References -> Add Reference -> Then picking Microsoft.CSharp Version 4.0.0.0 from the Framework Assemblies.

After I've added the reference if I look at the properties on the Microsoft.CSharp Assembly that I've added it shows as Version 0.0.0.0 Any idea what's wrong?

I'm using Visual Studio Ultimate 2013.

Here's what the references look like in the csproj file:

<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />

I'm not sure if this will be helpful to anyone else in the future, but I fixed these issues by fixing some other reference issues.

I had created this C# class library project using some proprietary scaffolding written by the company that I work for. The scaffolding is somewhat out of date and created some reference problems with some company-supplied references as well. At any rate, fixing these other references seem to fix the System.xml, Microsoft.Csharp, etc. ones as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM