Skip to content

Building the Runtime

Rowan Miller edited this page Jul 26, 2016 · 11 revisions

The first order of business is to make sure you can build the code on your machine.

  1. The easiest way to work with the code base is to install Visual Studio. You can also work with any other IDE provided you have .NET Framework 4.5 and MSBuild on your machine.
  2. You will need SQL Server Compact 3.5 installed.
  3. To run the unit tests, you will need SQL Server 2012 Express installed with SQL Server and Windows Authentication mode enabled.

The Windows username that you use for development must have the “sysadmin” role. The easiest way to ensure this is to install SQL Express while logged in as this user as opposed to having someone else install SQL Express on the machine.

  1. Using your preferred git client clone our git repo located at https://git01.codeplex.com/entityframework.

    git clone https://git01.codeplex.com/entityframework

    Note: The EF Runtime and EF Tooling share the same repo. If you've already cloned the repo to work with the tooling you can use your existing clone to work with the runtime also.

  2. In order to run unit tests against the delay-signed binaries, you need to run SkipStrongNames**. Obtain this and other NuGet packages from the OuterCurve Foundation NuGet public feed* by running the following command from a command prompt. This requires administrative privileges.

    build /t:RestorePackages
    build /t:EnableSkipStrongNames
    

    These commands only need to be run one time for each machine and do not need to be re-run every time you build.

  3. If you installed Visual Studio, you can now open the EntityFramework.sln file in the root of the source code and build using Visual Studio.

    Alternatively, there is a Build.cmd file that will build the code base and run the tests from the command line. Build should be run from the Developer Command Prompt for VS2013 (or VS2012)

    build
    
  4. Building the code will produce a .nupkg file for the EntityFramework NuGet package in bin\Release. You can create a local NuGet feed to use this NuGet package in your projects.

*By running build /t:RestorePackages, you will be initiating the download of other software from a NuGet-based feed that is owned by the Outercurve Foundation. You are responsible for locating, reading and complying with the license terms that accompany each such software. Each software that you obtain through this feed is licensed to you by its respective owner. We grant you no rights for third-party software from this feed.

**SkipStrongNames is required because the assemblies that are produced by building the open source code base are delay signed. Because the assemblies aren’t signed with the actual certificate we need to disable strong name verification for them. Delay signing ensures that the assemblies have the same strong name that they will have when signed with the Microsoft certificate and released on NuGet. Having the same strong name ensures products that build on top of Entity Framework (such as MVC Scaffolding) will work with open source builds.

Running Tests

The Entity Framework solution contains several test projects which are written using xUnit.net. The most straightforward way to run all tests is executing the following command.

build.cmd /t:Test

The tests can also be run from Visual Studio using an xUnit.net runner extension

Clone this wiki locally