Fixes https://github.com/dotnet/aspnetcore/issues/23759 |
||
|---|---|---|
| .. | ||
| BlazorTemplates.Tests | ||
| Shared | ||
| Web.Client.ItemTemplates | ||
| Web.ItemTemplates | ||
| Web.ProjectTemplates | ||
| Web.Spa.ProjectTemplates | ||
| migrations | ||
| scripts | ||
| test | ||
| testassets/DotNetToolsInstaller | ||
| .gitignore | ||
| .vsconfig | ||
| Directory.Build.props | ||
| Directory.Build.targets | ||
| GenerateContent.targets | ||
| ProjectTemplates.slnf | ||
| ProjectTemplatesNoDeps.slnf | ||
| README.md | ||
| THIRD-PARTY-NOTICES | ||
| TemplateProjects.props | ||
| build.cmd | ||
| build.sh | ||
| startvs.cmd | ||
| templates.nuspec | ||
| xunit.runner.json | ||
README.md
Templates
Getting Started
These are project templates which are used in .NET Core for creating ASP.NET Core applications.
Prerequisites
Some projects in this repository (like SignalR Java Client) require JDK installation and configuration of JAVA_HOME environment variable.
- If you don't have the JDK installed, you can find it from https://www.oracle.com/technetwork/java/javase/downloads/index.html
- After installation define a new environment variable named
JAVA_HOMEpointing to the root of the latest JDK installation (for Windows it will be something likec:\Program Files\Java\jdk-12). - Add the
%JAVA_HOME%\bindirectory to thePATHenvironment variable
Building Templates
-
Run
. .\activate.ps1if you haven't already. -
Run
git submodule update --init --recursiveif you haven't already. -
Run
git submodule updateto update submodules. -
Run
build.cmd -all -pack -configuration Releasein the repository root to build all of the dependencies. -
Run
build.cmd -pack -NoRestore -NoBuilddeps -configuration Releasein this directory will produce NuGet packages for each class of template in the artifacts directory. -
Because the templates build against the version of
Microsoft.AspNetCore.Appthat was built during the previous step, it is NOT advised that you install templates created on your local machine viadotnet new -i [nupkgPath]. Instead, use theRun-[Template]-Locally.ps1scripts in the script folder. These scripts dodotnet new -iwith your packages, but also apply a series of fixes and tweaks to the created template which keep the fact that you don't have a productionMicrosoft.AspNetCore.Appfrom interfering. -
The ASP.NET localhost development certificate must also be installed and trusted or else you'll get a test error "Certificate error: Navigation blocked".
-
Run
.\build.cmd -test -NoRestore -NoBuild -NoBuilddeps -configuration Release "/p:RunTemplateTests=true"to run template tests.
** Note** Templating tests require Visual Studio unless a full build (CI) is performed.