Skip to main content

Publish ASP.NET applications with Visual Studio 2019 or later

You can use the native Microsoft Publish utility in Visual Studio 2019 to prepare binaries and publish them for a specific project. You can then upload the files to Veracode for scanning. This procedure is an alternative to using Veracode Static for Visual Studio.

This procedure applies to compiling an application with Visual Studio using ASP.NET Core MVC 2.0.

For information about Visual Studio, see https://docs.microsoft.com/en-us/visualstudio/.

To complete this task:

  1. From the Visual Studio Solution Explorer, right-click the web application project file and select Publish...

    The Publish page opens, showing the current settings.

  2. Click Show all settings.

    The Publish All Settings page opens.

  3. Click the Connection tab.

  4. From the Publish method dropdown menu, select File System.

  5. Enter the filepath where you want to publish the web files and click Next.

  6. Click the Settings tab.

  7. In the Settings window, select the build configuration.

    Veracode recommends these settings:

    • Configuration: Debug
    • Deployment Mode: Framework-Dependent
    • Target Runtime: Portable
  8. Under File Publish Options, select or clear the option Delete all existing files prior to publish.

note

When you select this option, Visual Studio deletes all existing files from the location you chose when you publish. This step makes it easier for you to find the most recent DLL to upload, however, because it deletes pre-existing files, be careful when deciding the publish location.

  1. Click Save.

  2. On the Publish page, click Publish to generate the compiled files.

Results:

You can now browse to the bin directory in the published web files folder and upload them to Veracode.