Visual Studio Publish / Web Deploy

Web deploy can be used to upload a site developed through Visual Studio to the web server.  Using web deploy can help avoid issues like missing assemblies that might occur when uploading a Visual Studio project via FTP.  Note that the steps below are for Visual Studio 2017.
 
For Core projects using Framework 2.x or later, the module name has changed from AspNetCoreModule to AspNetCoreModuleV2.  Additional information regarding Core Module AspNetCoreModuleV2 is found after the Publish section.
 
 
Set up a publish profile
 
In Visual Studio, right click the project and select Publish from the menu.
 
 
 
 
Select IIS, FTP, etc as the publish target and click Publish.
 
 
 
 
The web deploy connection settings required are
 
Server:  https://wdeploy.everleap.com
Site name:  a series of digits separated by a hyphen (see Web Deploy Pane below)
User name:  SiteName\UserID (see Web Deploy Pane below)
Password:  the FTP / Everleap Control Panel password
Destination URL:  optional and can be left blank; used for a redirection after the site is successfully deployed
 
After entering the connection information, click Validate Connection.  If there is a check mark and the project has no database, click Save.  If there is a database, click Next to set up the connection string.
 
 
 
 
Web Deploy Settings
 
The connection settings for Web Deploy can be reviewed on the applicable Site Overview page.  Found at Everleap Control Panel > Sites (https://cp.everleap.com/sites/) > Manage (if multi-site plan) > select Web Deploy from the bottom pane
 
 
 
 
Connection String
 
If a connection string is required for the deployed project, an Everleap database connection string can be found at Everleap Control Panel > Databases > Shared MS SQL (or Private MS SQL) > Manage (applicable database).  Note that the example Connection String does not contain the database password in plain text, so it will need to be updated after copying it to Visual Studio.  After adding the connection string, Save.
 
 
 
 
Deployment Mode in Core
 
Deployment Mode for Core applications depends on the version being deployed.  If deploying a Core 2.2.0 or earlier project, Framework-Dependent deployment may be used.  Self-Contained deployment should be used for any newer version.
 
 
 
 
Publish
 
After saving the publish profile, the left pane in Visual Studio should update.  Click Publish to deploy the project to the web server.
 
 
 
 
Core Module AspNetCoreModuleV2
 
The module name change from AspNetCoreModule to AspNetCoreModuleV2 will cause the following Internal Server Error after deploying a Core project using Framework 2.x or newer.
 
 
To resolve the issue, after deployment download the web.config via FTP and add the module as in the syntax below, then upload the updated web.config back to the site.
 
<configuration>
 <system.webServer>
  <modules>
   <remove name="AspNetCoreModuleV2" />
   <add name="AspNetCoreModuleV2" />
  </modules>
 </system.webServer>
</configuration>
 
For reference, the completed web.config for a Core project with the added module would look similar to the following.
 
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <modules>
        <remove name="AspNetCoreModuleV2" />
        <add name="AspNetCoreModuleV2" />
      </modules>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\CoreApplication.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>