Skip to content

Building the Tools

lajones edited this page Dec 7, 2016 · 4 revisions

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

  1. Install the following pre-requisites:
  1. Using your preferred git client clone our git repo located at https://github.com/aspnet/EntityFramework6.git.

    git clone https://github.com/aspnet/EntityFramework6.git
    

    Note: The EF Runtime and EF Tooling share the same repo. If you've already cloned the repo to work with the runtime you can use your existing clone to work with the tooling 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.

    BuildEFTools /t:RestorePackages 
    BuildEFTools /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.

  1. You can now open the EFTools.sln file in the root of the source code and build using Visual Studio. There is also an EFToolsSetup.sln which will allow you to build the installer, but actual installation of the installer must be run from the command line because Visual Studio must be closed during this process.

    There is an BuildEFTools.cmd file that can be used to build the code base, install the designer, and run the tests from the command line. This command should be run from the Developer Command Prompt for VS2013 (or VS2012)

    The following command will build the tooling, create the setup MSI, and install the newly built tooling into Visual Studio. Note, this will require that you close any open instances of VS. Remember to use Developer Command Prompt.

    BuildEFTools /t:Install
    

    If you want to build the tooling and setup MSI without installing it, you can use the following command.

    BuildEFTools /t:Build
    

* 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

There are two small, one-time tasks that you need to perform within Visual Studio before running the tests.

  • Disable the Text Templating security message:
  1. Tools > Options > Text Templating
  2. Ensure Show Security Message is set to False
  • Set SQL Server as the default provider for the ASP.NET connection dialog
  1. Tools > Connect to Database...

  2. For Data source, select Microsoft SQL Server

  3. At the bottom, check Always use this selection

  4. Click OK

  5. Enter .\SQLEXPRESS or (localdb)\v11.0 for server name (depending on which database is available)

    If you installed VS2012, .\SQLEXPRESS is available by default

    If you installed VS2013, (localdb)\v11.0 is available by default

  6. Enter master for database name

  7. Click OK

  • When testing on VS 2012 or VS 2013, set Windows text and scaling to 100%, e.g. on Windows 8:
  1. Open Control Panel
  2. Open Appearance and Personalization
  3. Open the option "Make text and other items larger or smaller" under "Display"
  4. Move the slider to the smallest setting and click Apply
  5. Logout and login back again for scaling changes to be effective

Running the following command will build everything, install the tooling and run the tests.

BuildEFTools

You can also use the following command to just run the tests against the already built and installed tooling.

BuildEFTools /t:Test

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

Clone this wiki locally