views:

58

answers:

2

I had a rather large solution properly compiling until my power went out.

Now, I have a standard Linq to Sql DataContext class defined in one project, and it compiles properly, however another project that references that assembly refuses to compile Linq properly.

I'm getting compile errors like

'DataLayer.AdminDataContext': type used in a using statement must be implicitly convertible to 'System.IDisposable'

from a simple

using (DataLayer.AdminDataContext context = new DataLayer.AdminDataContext()) {...}

and errors like

'System.Data.Linq.Table'1<DataLayer.User>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Data.Linq.Table'1<DataLayer.User>' could be found (are you missing a using directive or an assembly reference?)

from

var users = context.Users.Where(u=>u.Username == Username);

I've cleared out every files from

Windows\Microsoft.Net\Framework\v2.0.50727\Temporary ASP.NET Files Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files

and I've attempted 'Clean Solution' and every variant of Rebuild I can concoct, to zero success. Does anyone have any ideas why one project in a solution won't compile, while others will? The DataLayer project seems to compile Linq fine, and recognizes "using" and "Where" without an issue, while the other project won't compile.

A: 

Shot in the dark but try launching VS with the /ResetSkipPkgs switch

http://msdn.microsoft.com/en-us/library/ms241276(VS.80).aspx

TheNextman
Unfortunately this didn't help at all, but thanks for the suggestion.
Thinjon100
A: 

"does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type "

I've seen this error when there is a missing reference to the System.Core assembly or a missing "using System.Linq" at the top of the file.

Aaron Marten
All the using statements are there. System.Linq, etc. It was compiling, but ceased to after the reboot, with no code changes.
Thinjon100