Precompile ASP.NET Core MVC views with Visual Studio 2017 or later
You can use Veracode Static for Visual Studio to precompile and publish your ASP.NET Core web applications.
This section explains how to use the file Publish functionality in Visual Studio 2017 or later to manually produce a precompiled views DLL file. You can also automate the precompilation using the MSBuild command-line tool.
This procedure applies to precompiling an application using Visual Studio using ASP.NET Core MVC 2.0.
-
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.
As of ASP.NET Core 6.0, both views and application types are available in a single
AppName.dll
assembly. For more information, see the Microsoft documentation. -
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.