4
votes

I am using Visual Studio Team Services as source control and have enabled continuous integration.

My project is an ASP.NET application which used Entity Framework 5. When i checkin the code and the build controller tries to build it, the following errors come up

DataModel\GenomicsTutorDataModel.Context.cs (40): The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1578): Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

In my solution i have made system.data.entity CopyLocal = True yet no success.

Any ideas?

2
Is Entity Framework coming from NuGet? If so, you should be able to enable NuGet package restore, which should take care of the issue.Daniel Mann

2 Answers

1
votes

May be you are on a 64 bits machine and the TFS server is not? Try to build your project for Any CPU or x86.

0
votes

Add the DLL you referenced for System.Data.Entity into a folder in your project or somewhere in a folder in the Source Control and reference to that one. Check this in and try to build your application again.