aspnetcore/src/Microsoft.AspNetCore.Certif...
Mike Harder 5618fa52d8 Update MSBuild to 15.3.0-* (#320)
- Matches version shipping with Visual Studio 15.3
2017-07-11 17:47:28 -07:00
..
build
CertificateManager.cs
GenerateSSLCertificateTask.cs
Microsoft.AspNetCore.CertificateGeneration.Task.csproj Update MSBuild to 15.3.0-* (#320) 2017-07-11 17:47:28 -07:00
README.md

README.md

Microsoft.AspNetCore.CertificateGeneration.Task

Microsoft.AspNetCore.CertificateGeneration.Task is an MSBuild task to generate SSL certificates for use in ASP.NET Core for development purposes.

How To Install

Install Microsoft.AspNetCore.CertificateGeneration.Task as a PackageReference to your project.

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.CertificateGeneration.Task" Version="2.0.0" />
  </ItemGroup>

How To Use

The command must be executed in the directory that contains the project with the reference to the package.

Usage: dotnet msbuild /t:GenerateSSLCertificate [/p:ForceGenerateSSLCertificate=true]

Testing scenarios

On a machine without an SSL certificate generated by this task. Create a netcoreapp2.0 mvc application using

dotnet new mvc

Then try to run the app using:

dotnet run

When the application fails to run due to a missing SSL certificate. Run:

dotnet msbuild /t:GenerateSSLCertificate

Run the application again using:

dotnet run

The application should run successfully. You will still have to trust the certificate as a separate step.