- Download ASP.NET Boilerplate template
- Fix EFCore Versions & Add DotNet Tooling
- Change Database Connection String
- Restore NuGet Packages
- Create Database
- Run Backend
- Install NPM Dependencies
- Refresh Swagger Proxies
- Run Frontend
Goto the ASP.NET Boilerplate website and download the ASP.NET Core 1.x template using the .NET Core 1.1 framework, select Single Page Web Application using Angular 2 and make sure Include module-zero is checked.
This step is specific to ABP 2.0.2 and can be ignored for later versions.
Edit project.EntityFrameworkCore.csproj found in the /aspnet-core/src/project.EntityFrameworkCore directory and update the references to the ones below:
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
</ItemGroup>
Note there is an extra reference added to enable using the Entity Framework Core CLI. Now add the CLI tool reference:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
</ItemGroup>
Edit the appsettings.json file in the .Web.Host folder, and update the connection string to change the Data Source to use localdb.
"ConnectionStrings": {
"Default": "Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog=PeopleProject;"
}
Initial Catalog is the name you want to use for the database.
We will use the .NET Core Shared Framework Host (dotnet
) to restore the projects' NuGet packages and run our Entity Framework Core commands.
Open PowerShell, navigate to the /aspnet-core directory and run
dotnet restore
Still in PowerShell go to the .EntityFrameworkCore directory and run
dotnet ef
If you don't see the unicorn, something has gone wrong. Otherwise run
dotnet ef database update
Start Visual Studio 2017 and open the solution. Set the .Web.Host project as the Startup Project and debug the solution.
In the /angular directory run:
yarn install
Versions before 2.3.0 use NPM instead of Yarn.
npm install
This will take some time while it downloads all the dependencies.
While not technically necessary now navigate to the /angular/nswag directory and run:
refresh.bat
Return to the /angular directory and run:
yarn start
Versions before 2.3.0 use NPM instead of Yarn.
npm start
This will start the frontend as well as the continuous transpiling so that as you edit the typescript and HTML files and save the code is immediately compiled and the application refreshed.
Open a web browser and navigate to the client site:
http://localhost:4200
At this point we've downloaded, initialized and run the bare template. Well done on making it this far. Now we can start to create our own customizations on top of the ASP.NET Boilerplate platform.