Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Getting and Building the Code
The following prerequisites are required to work with the EF Core code:
- Visual Studio 2017 15.8
- .NET Core 2.2 Preview SDK (Installed by build script automatically)
Clone the repository
Using your favorite git client, clone the repository.
git clone https://github.com/aspnet/EntityFrameworkCore.git
Run at least the following before using Visual Studio for the first time:
If you get a ⚠️ warning about KoreBuild using different dotnet than the one which exists in PATH variable, then you need to update your PATH variable such that dotnet installed by KoreBuild in
%USERPROFILE% appears before any other dotnet installed. Only after that opening solution in Visual Studio will work correctly. See Updating PATH to use preview .NET Core SDK under Build from Visual Studio for more information on steps.
Build from the command line
To build and run tests:
To build and create packages without running tests:
Build from Visual Studio
- Just open the .sln file. (After running the build initialization from the command line and updating your Path if needed.)
- NuGet packages will already have been restored, so you can switch off auto package restore in Visual Studio.
Updating PATH to use preview .NET Core SDK
- Since KoreBuild installs preview version of .NET Core SDK in
%USERPROFILE%folder, your path needs to use that dotnet for VS to work correctly. Especially the preview version of dotnet should appear before any other dotnet in your PATH variable. You can either set your environment variables globally and just open solution in VS normally or you can set PATH variable locally in command line and open solution from command line. Following are steps to update PATH locally & open solution in VS in PowerShell. Similar steps can be used in any other command terminal. (drop
/x64if you are on 32 bit machine)
.\build /t:Compile $env:PATH="$env:USERPROFILE/.dotnet/x64;"+$env:PATH .\EFCore.sln
Solving common build errors
- Check that the package source URLs listed in the Nuget.config file in the root of the repository are accessible.
- Clean the source directory.
git clean -xidwill clean files in the EF source directory.
- Clear nuget packages and caches.
nuget.exe locals all -clearwill delete the NuGet caches. (You can get nuget.exe from https://dist.nuget.org/index.html or use
- Reinstall .NET Core CLI. Our build script automatically installs a version to
Other test runners may also work--people have had luck with the ReSharper test runner and the CodeRush runner.
Some people on the team use ReSharper to increase productivity. Currently the EAP builds of the latest release seem to be working well. Some people see better performance if ReSharper testing support is disabled.