You can use the file publish functionality in Visual Studio 2017 to produce a precompiled views DLL file.
About this task
You can precompile your application using the Visual Studio Publish feature in the following steps, or you can automate the precompilation using the MSBuild command-line tool.
For ASP.NET Core MVC 1.1, you must add the NuGet package Microsoft.AspNetCore.Mvc.Razor.ViewCompilation or edit the CSPROJ file as described in steps 1—7. You can then precompile your application using the Visual Studio Publish feature in steps 8—12 or you can use the MSBuild command-line tool instead of that procedure.
- In Visual Studio 2017, go to .
- Browse for the NuGet package Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.
Select the options shown below, specifically version 1.1.0.
- Click Install to add the package to ASP.NET Core 1.1.
- From the Solution Explorer, right-click the web application project file, and select Edit .csproj.
In the property group section of the CSPROJ file, add
- Save and close the .csproj file to reload the project.
- From the Solution Explorer, right-click the web application project file and select Publish....
- Verify the Configuration is set to Debug.
From the Publish tab of your web application, create a
folder, and click Publish.
The output folder contains the application binaries in combination with the precompiled views.
After precompiling the web application, zip the folder containing the published
output, and upload it to the Veracode Platform by clicking
Add in the Additional Files section.
- Scan the folder used for the precompilation file output.