views:

200

answers:

2

I just upgraded from VS2008 to VS2010. In the process, I allowed it to upgrade my DLL's to 4.0. I've decided that wasn't a good idea and now I've rolled back.

It all works fine in VS2010, but when it hits my CI server (CruiseControl.Net), I get an error of:

The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?

3.5 is on the server, and other projects that use 3.5 build fine, so I don't think it's a framework issue.

Anyone have any hints?

+6  A: 

Make sure you have a reference to System.Core.dll.

Reed Copsey
I've tried that :) Specifically, when you do that, it tells you that you cannot add a reference to System.Core since it's included by default.
CubanX
Is it there, in your list? Is it set to the correct version? If not, you'll need to hand-edit your project to correct it...
Reed Copsey
Giving you an upvote for being in the ballpark Reed :) I saw your comment after I found the solution.
CubanX
+4  A: 

I do have a reference to System.Core, but it turned out for one of my projects, when I downgraded, it did not add this bit back into my project file:

<Reference Include="System.Core">
  <RequiredTargetFramework>3.5</RequiredTargetFramework>
  <Private>False</Private>
</Reference>

The key part there being the RequiredTargetFramework. I was clued into this because it wasn't only Linq that wasn't being found, but also Func<> and Extension method attributes.

It was all 3.5 stuff that was missing.

CubanX
I've just done EXACTLY the same as you... Thanks for saving me some frustration!
NeilD