|
|
4 ani în urmă | |
|---|---|---|
| .. | ||
| BlazorTemplates.Tests | 4 ani în urmă | |
| Shared | 4 ani în urmă | |
| TestInfrastructure | 4 ani în urmă | |
| Web.Client.ItemTemplates | 4 ani în urmă | |
| Web.ItemTemplates | 4 ani în urmă | |
| Web.ProjectTemplates | 4 ani în urmă | |
| migrations | 7 ani în urmă | |
| scripts | 4 ani în urmă | |
| test | 4 ani în urmă | |
| testassets | 5 ani în urmă | |
| .gitignore | 7 ani în urmă | |
| .vsconfig | 4 ani în urmă | |
| Directory.Build.props | 4 ani în urmă | |
| Directory.Build.targets | 4 ani în urmă | |
| GenerateContent.targets | 4 ani în urmă | |
| ProjectTemplates.slnf | 4 ani în urmă | |
| ProjectTemplatesNoDeps.slnf | 4 ani în urmă | |
| README.md | 4 ani în urmă | |
| THIRD-PARTY-NOTICES | 5 ani în urmă | |
| TemplateProjects.props | 6 ani în urmă | |
| build.cmd | 4 ani în urmă | |
| build.sh | 4 ani în urmă | |
| startvs.cmd | 5 ani în urmă | |
| templates.nuspec | 6 ani în urmă | |
| xunit.runner.json | 5 ani în urmă | |
These are project templates which are used in .NET Core for creating ASP.NET Core applications.
The following contains a description of each sub-directory in the ProjectTemplates directory.
BlazorTemplates.Tests: Contains the source files for the Blazor template tests, these are currently split out due to not being Helix ready yet.Shared: Contains a collection of shared constants and helper methods/classes including the infrastructure for managing dotnet processes to create, build, run template tests.Web.Client.ItemTemplates: Contains the Web Client-Side File templates, includes things like less, scss, and typescriptWeb.ItemTemplates: Contains the Web File templates, includes things like: protobuf, razor component, razor page, view import and start pagesWeb.ProjectTemplates: Contains the ASP.NET Core Web Template pack, including Blazor Server, WASM, Empty, Grpc, Razor Class Library, RazorPages, MVC, WebApi.migrations: Contains migration related scripts.scripts: Contains a collection of scripts that help running tests locally that avoid having to install the templates to the machine.test: Contains the end to end template tests.testassets: Contains assets used by the tests, like a dotnet tools installerSome projects in this repository (like SignalR Java Client) require JDK installation and configuration of JAVA_HOME environment variable.
JAVA_HOME pointing to the root of the latest JDK installation (for Windows it will be something like c:\Program Files\Java\jdk-12).%JAVA_HOME%\bin directory to the PATH environment variableMicrosoft.DotNet.Web.Spa.ProjectTemplates.csproj contains the Single Page Application templates, including Angular, React. This is brought in by a submodule from the dotnet/spa-templates repo.
To build the ProjectTemplates, use one of:
eng\build.cmd -all -pack -configuration Release in the repository root to build and pack all of the repo, including template projects.src\ProjectTemplates\build.cmd -pack -configuration Release to produce NuGet packages only for the template projects.
Note use eng/build.sh or src/ProjectTemplates/build.sh on non-Windows platforms.
To run ProjectTemplate tests, first ensure the ASP.NET localhost development certificate is installed and trusted. Otherwise, you'll get a test error "Certificate error: Navigation blocked".
Then, use one of:
src\ProjectTemplates\build.cmd -test -NoRestore -NoBuild -NoBuilddeps -configuration Release (or equivalent src\ProjectTemplates\build.sh` command) to run all template tests.Run-[Template]-Locally.ps1 scripts in the script folder.
dotnet new -i with 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 production Microsoft.AspNetCore.App from interfering.custom-hive and disable-sdk-templates to install to a custom location and turn off the built-in templates e.g.
dotnet new -i Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-dev.nupkg --debug:custom-hive C:\TemplateHive\dotnet new angular --auth Individual --debug:disable-sdk-templates --debug:custom-hive C:\TemplateHive\src\ProjectTemplates\build.cmd -pack -configuration Release
*dev.nupkg containing the ProjectTemplates at artifacts\packages\Release\Shipping\Microsoft.DotNet.Web.ProjectTemplates.7.0.7.0.0-dev.nupkgdotnet new -i "<REPO_PATH>\artifacts\packages\Release\Shipping\Microsoft.DotNet.Web.ProjectTemplates.7.0.7.0.0-dev.nupkg"dotnet new --uninstall Microsoft.DotNet.Web.ProjectTemplates.7.0Note ProjectTemplates tests require Visual Studio unless a full build (CI) is performed.
Note Because the templates build against the version of Microsoft.AspNetCore.App that was built during the
previous step, it is NOT advised that you install templates created on your local machine using just
dotnet new -i [nupkgPath].
For more information, see the ASP.NET Core README.