System.Core in VS2010 Projects

Posted by: Steven Smith, on 24 Aug 2010 | View original | Bookmarked: 0 time(s)

I just ran into an odd issue with a VS2010 project.  In my case it was an MVC 2 application I was upgrading from VS2008.  One of the built-in controllers (ProfileController) was failing to compile because it could not resolve the Linq extension method symbols Single() and Matches().  These are located in the System.Core assembly.  I checked my project references in Solution Explorer, and System.Core was not listed.  So I tried Add Reference, and System.Core was listed as included and gave me the option of to Remove it.

SNAGHTML4f275de

After some searching, I found this blog post, aptly named Do NOT remove the reference to System.Core from your VS2010 Project.  It pointed out that this file is special and that if you remove it (or it gets lost somehow) you need to re-add it manually to your project using this syntax:

  <ItemGroup>
    <Reference Include="System.Core" />
  </ItemGroup>

There is also a connect issue describing this bug (which is currently marked as Postponed), Cannot remove System.Core.dll reference from a VS2010 project.

In my case this appears to have been an upgrade issue, as the project worked fine in VS2008 before I ran the upgrade wizard to VS2010, and then in the course of trying to get it to compile for the first time, I ran into this issue.  Adding the assembly to the project file by hand (via Notepad) solved the problem in my case.


Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XLinq | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 608 | Hits: 9

Similar Posts

  • VS10 Beta 2 From an ASP.NET MVC Perspective more
  • My History of Visual Studio (Part 10, final) more
  • My History of Visual Studio (Part 9) more
  • My History of Visual Studio (Part 7) more
  • How to retire (respectfully) legacy systems more
  • Working on Silverlight .NET RIA Services Part 2 more
  • Multi-Monitor Support (VS 2010 and .NET 4 Series) more
  • How to install and configure Visual Studio Team Explorer more
  • Visual Studio Add-In vs. Integration Package Part 3 more
  • Open SQL Port for specific IP by ASP.NET Website more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD