If you have downloaded the March CTP (and you have, haven’t you?) you might have noticed that the LINQ to Entities samples were not functioning correctly right out of the gate. Unfortunately in the fast moving world of CTP development, sometimes the samples and the code get out of sync, and this was one of those times. However, it is not too difficult to get the samples back up and running. Simply follow these steps, and you should be golden.
1. Change MergeOption.NoCaching to MergeOption.NoTracking in the LinqtoEntitiesSamples.cs file
2. Remove ClientAutoGenerated=”true” and StoreGenerated=”true” from the EntityNorthwind.csdl file (found in the LinqToEntities folder)
3. Either delete the bin folder, or delete all files in the output folder, as there are some files in it that causes problems.
4. If you get a “database already exists” exception, please add “User Instance=true” in the connection string in the LinqToEntitiesSamples.cs file.
Once you’ve performed these steps, you should be up and running!
We will be updating the samples with these changes, and an announcement will be made at that time as to where to get the download, but in the meantime, this should work.
Please contact me if you are still having problems.
ADO.NET Program Manager