SlideShare a Scribd company logo
How to publish ASP.NET Core web application via Visual Studio 2019
Authoring Tools > Visual Studio 2019
This article contains the most detailed steps for publishing ASP.NET Core web application to our
web server using Visual Studio 2019.
1. Initial Setup at SmarterASP.net
Create a website and a SQL Server database from your hosting Control Panel. For more details,
please check the below links
1. Create a website
2. Create a database
In the section following we will review some of the detail of the setup in order to get the values to
need to publish the project
2. Creating the Project in Visual Studio
Build the project using the Visual Studio templates:
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
1 de 14 01/02/2022 12:11 p. m.
 
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
2 de 14 01/02/2022 12:11 p. m.
 
Since all your sites are using the same application pool in the hosting plan, please use
OutOfPorcess hosting model for all your ASP.NET Core applications.
 
You can easily configure the setting in local VS, this will publish the application as OutOfProcess
hostingModel automatically.
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
3 de 14 01/02/2022 12:11 p. m.
 
 
Please note, in this example, Individual User Accounts is selected for Authentication.  This means
that the default build will include a database context “ApplicationDbContext” and a migration for
creating the Identity Schema. Once the project is created and the command "Update-Database" is
run in the VS Package Manager Console, a local database instance is created with a set of tables
associated with the user identity.  These can be seen by viewing the "localdb" in the VS SQL Server
Object Explorer.
It is not a requirement to use individual user accounts, however, if the project does not, it will be
necessary to create a database context, add one or more data object, and run the "Add-Migration
Initial" and "Update-Database" commands in the VS Package Manager Console in order to
demonstrate the steps involving the database.
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
4 de 14 01/02/2022 12:11 p. m.
 
3. Preparing to Publish the Project
There are several critical, and somewhat cryptic, values that need to be entered into the VS
Publish dialogs and it is useful to collect these in advance.
 
For more details on how to find Web Deployment Information 
 
The database connection string can be found by selecting the “Databases” icon from your Control
Panel, and then the “Connection String Examples”.  Use the option titled “ASP.NET”.
Note that this string includes the user name and password credential for the database (not to be
confused with those of the site.)  Your user name will be shown correctly but you will need to fill
in your password.
Database Connection String:  The database connection that will be used after the site is
published.  Note that this value is not stored in the project file “appsettings.json”, which stores
the “Default Connection” to the local database.
For more details on how to find your database connection string
 
4. Publish the Project
Right-click on the project name in the VS Solution Explorer and select Publish from the context
menu.
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
5 de 14 01/02/2022 12:11 p. m.
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
6 de 14 01/02/2022 12:11 p. m.
 
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
7 de 14 01/02/2022 12:11 p. m.
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
8 de 14 01/02/2022 12:11 p. m.
 
Enter the real password and check "Save password", click "Validate connection"  button, in the
upcoming window, click "Accept".
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
9 de 14 01/02/2022 12:11 p. m.
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
10 de 14 01/02/2022 12:11 p. m.
 
Press the Next button to get to the second screen.
 
On the second screen, accept default values:
    Configuration: Release
    Target Framework: net5.0
    Deployment Mode: Framework-Dependent Note: you can choose 'Self-Contained' if the core
version is not installed on the server.
    Target Runtime: Portable
Expand the lists on the second screen and check all of the boxes on both screens.  Note that VS
may fill in the database field(s) with the local connection. This is incorrect; both the Databases
and the Entity Framework Migrations text fields should contain the path to the database on the
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
11 de 14 01/02/2022 12:11 p. m.
server, as you got from step #3.
 
 
 
If you get the error "ERROR_CERTIFICATE_VALIDATION_FAILED", please re-validate the connection in
the previous captured "Publish Connection" window, or add the following line in .pubxml file.
<AllowUntrustedCertificate>true</AllowUntrustedCertificate>
If you want to set value of ASPNETCORE_ENVIRONMENT while deploying, please add the following
line in .pubxml file.
<EnvironmentName>Production</EnvironmentName>
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
12 de 14 01/02/2022 12:11 p. m.
 
 
 
Once you have created a profile you can reuse it every time that you publish by simply running the
Publish command.
Observer the Output window in VS to see if the publication worked properly.
 
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
13 de 14 01/02/2022 12:11 p. m.
Article ID: 2135, Created: abril 8, 2021 at 01:53 a. m., Modified: abril 14, 2021 at 08:38 p. m.
How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co...
14 de 14 01/02/2022 12:11 p. m.

More Related Content

DOCX
James Sooter Resume 2016
PPS
04 asp.net session05
PPSX
04 asp.net session05
PPS
Asp.Net 2.0 Presentation
PPSX
11 asp.net session16
DOC
Asp.Net Tutorials
PPT
Useful Rails Plugins
PPTX
Web forms in ASP.net
James Sooter Resume 2016
04 asp.net session05
04 asp.net session05
Asp.Net 2.0 Presentation
11 asp.net session16
Asp.Net Tutorials
Useful Rails Plugins
Web forms in ASP.net

What's hot (19)

PDF
A Work Day Of A Web Developer
PPTX
New Features of ASP.NET 4.0
PDF
IBM Connections mail with exchange backend
DOC
Tutorial asp.net
PPTX
ASP.NET Lecture 1
PPTX
Access Services On SharePoint 2010
PDF
How-to Create a 'Lock' record in Salesforce
PPSX
03 asp.net session04
PPTX
Cloud Computing with AWS
PPSX
ASP.NET Web form
PPTX
ASP.NET Lecture 3
PPTX
ESPC19 - Build Your First Microsoft Teams App Using SPFx
PDF
Firebase Auth Tutorial
PDF
Aspnet master pages_tutorial_10_cs
PPTX
Branding SharePoint from Prototype to Deployment - Workshop
PPT
ASP.NET 06 - Customizing Your Sites Appearance
PPSX
12 asp.net session17
PPTX
WebMatrix2
PPTX
Mule with facebook
A Work Day Of A Web Developer
New Features of ASP.NET 4.0
IBM Connections mail with exchange backend
Tutorial asp.net
ASP.NET Lecture 1
Access Services On SharePoint 2010
How-to Create a 'Lock' record in Salesforce
03 asp.net session04
Cloud Computing with AWS
ASP.NET Web form
ASP.NET Lecture 3
ESPC19 - Build Your First Microsoft Teams App Using SPFx
Firebase Auth Tutorial
Aspnet master pages_tutorial_10_cs
Branding SharePoint from Prototype to Deployment - Workshop
ASP.NET 06 - Customizing Your Sites Appearance
12 asp.net session17
WebMatrix2
Mule with facebook
Ad

Similar to How to publish ASP.NET Core web application via Visual Studio 2019.pdf (20)

DOCX
Implementing a document viewer in ASP.NET Core 8.0
PDF
Murach : How to develop a single-page MVC web
PPTX
ASP.NET Core 2.0: The Future of Web Apps
DOCX
Implementing a file manager in ASP.NET Core 8.0
PDF
Upgrading From Rovius CloudPlatform to Apache CloudStack
PPTX
Spring boot-application
PDF
Asp.net Web Development.pdf
PDF
Chapter 1 (asp.net over view)
PDF
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
PDF
White Paper : ASP.NET Core AngularJs 2 and Prime
PDF
"Running Node.js in your browser with WebContainers", Oleksandr Zinevych
 
PDF
Cloud and Ubiquitous Computing manual
PDF
ASP.NET Identity
PDF
C# with Renas
PPTX
ASP.NET Core 2.1: The Future of Web Apps
PPTX
ASP.NET Presentation
PPTX
ASP.NET Core 2.1: The Future of Web Apps
PDF
Building richwebapplicationsusingasp
PDF
Asp.net core tutorial
PDF
Spring Boot
Implementing a document viewer in ASP.NET Core 8.0
Murach : How to develop a single-page MVC web
ASP.NET Core 2.0: The Future of Web Apps
Implementing a file manager in ASP.NET Core 8.0
Upgrading From Rovius CloudPlatform to Apache CloudStack
Spring boot-application
Asp.net Web Development.pdf
Chapter 1 (asp.net over view)
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
White Paper : ASP.NET Core AngularJs 2 and Prime
"Running Node.js in your browser with WebContainers", Oleksandr Zinevych
 
Cloud and Ubiquitous Computing manual
ASP.NET Identity
C# with Renas
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Presentation
ASP.NET Core 2.1: The Future of Web Apps
Building richwebapplicationsusingasp
Asp.net core tutorial
Spring Boot
Ad

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Digital Strategies for Manufacturing Companies
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Introduction to Artificial Intelligence
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
assetexplorer- product-overview - presentation
PPTX
history of c programming in notes for students .pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Digital Strategies for Manufacturing Companies
Operating system designcfffgfgggggggvggggggggg
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Designing Intelligence for the Shop Floor.pdf
Softaken Excel to vCard Converter Software.pdf
Introduction to Artificial Intelligence
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Digital Systems & Binary Numbers (comprehensive )
2025 Textile ERP Trends: SAP, Odoo & Oracle
wealthsignaloriginal-com-DS-text-... (1).pdf
Reimagine Home Health with the Power of Agentic AI​
assetexplorer- product-overview - presentation
history of c programming in notes for students .pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

How to publish ASP.NET Core web application via Visual Studio 2019.pdf

  • 1. How to publish ASP.NET Core web application via Visual Studio 2019 Authoring Tools > Visual Studio 2019 This article contains the most detailed steps for publishing ASP.NET Core web application to our web server using Visual Studio 2019. 1. Initial Setup at SmarterASP.net Create a website and a SQL Server database from your hosting Control Panel. For more details, please check the below links 1. Create a website 2. Create a database In the section following we will review some of the detail of the setup in order to get the values to need to publish the project 2. Creating the Project in Visual Studio Build the project using the Visual Studio templates:   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 1 de 14 01/02/2022 12:11 p. m.
  • 2.     How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 2 de 14 01/02/2022 12:11 p. m.
  • 3.   Since all your sites are using the same application pool in the hosting plan, please use OutOfPorcess hosting model for all your ASP.NET Core applications.   You can easily configure the setting in local VS, this will publish the application as OutOfProcess hostingModel automatically.   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 3 de 14 01/02/2022 12:11 p. m.
  • 4.     Please note, in this example, Individual User Accounts is selected for Authentication.  This means that the default build will include a database context “ApplicationDbContext” and a migration for creating the Identity Schema. Once the project is created and the command "Update-Database" is run in the VS Package Manager Console, a local database instance is created with a set of tables associated with the user identity.  These can be seen by viewing the "localdb" in the VS SQL Server Object Explorer. It is not a requirement to use individual user accounts, however, if the project does not, it will be necessary to create a database context, add one or more data object, and run the "Add-Migration Initial" and "Update-Database" commands in the VS Package Manager Console in order to demonstrate the steps involving the database.   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 4 de 14 01/02/2022 12:11 p. m.
  • 5.   3. Preparing to Publish the Project There are several critical, and somewhat cryptic, values that need to be entered into the VS Publish dialogs and it is useful to collect these in advance.   For more details on how to find Web Deployment Information    The database connection string can be found by selecting the “Databases” icon from your Control Panel, and then the “Connection String Examples”.  Use the option titled “ASP.NET”. Note that this string includes the user name and password credential for the database (not to be confused with those of the site.)  Your user name will be shown correctly but you will need to fill in your password. Database Connection String:  The database connection that will be used after the site is published.  Note that this value is not stored in the project file “appsettings.json”, which stores the “Default Connection” to the local database. For more details on how to find your database connection string   4. Publish the Project Right-click on the project name in the VS Solution Explorer and select Publish from the context menu. How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 5 de 14 01/02/2022 12:11 p. m.
  • 6.   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 6 de 14 01/02/2022 12:11 p. m.
  • 7.     How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 7 de 14 01/02/2022 12:11 p. m.
  • 8.   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 8 de 14 01/02/2022 12:11 p. m.
  • 9.   Enter the real password and check "Save password", click "Validate connection"  button, in the upcoming window, click "Accept".   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 9 de 14 01/02/2022 12:11 p. m.
  • 10.   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 10 de 14 01/02/2022 12:11 p. m.
  • 11.   Press the Next button to get to the second screen.   On the second screen, accept default values:     Configuration: Release     Target Framework: net5.0     Deployment Mode: Framework-Dependent Note: you can choose 'Self-Contained' if the core version is not installed on the server.     Target Runtime: Portable Expand the lists on the second screen and check all of the boxes on both screens.  Note that VS may fill in the database field(s) with the local connection. This is incorrect; both the Databases and the Entity Framework Migrations text fields should contain the path to the database on the How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 11 de 14 01/02/2022 12:11 p. m.
  • 12. server, as you got from step #3.       If you get the error "ERROR_CERTIFICATE_VALIDATION_FAILED", please re-validate the connection in the previous captured "Publish Connection" window, or add the following line in .pubxml file. <AllowUntrustedCertificate>true</AllowUntrustedCertificate> If you want to set value of ASPNETCORE_ENVIRONMENT while deploying, please add the following line in .pubxml file. <EnvironmentName>Production</EnvironmentName> How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 12 de 14 01/02/2022 12:11 p. m.
  • 13.       Once you have created a profile you can reuse it every time that you publish by simply running the Publish command. Observer the Output window in VS to see if the publication worked properly.   How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 13 de 14 01/02/2022 12:11 p. m.
  • 14. Article ID: 2135, Created: abril 8, 2021 at 01:53 a. m., Modified: abril 14, 2021 at 08:38 p. m. How to publish ASP.NET Core web application via Visual Studio 2019 https://www.smarterasp.net/support/kb/a2135/how-to-publish-asp_net-co... 14 de 14 01/02/2022 12:11 p. m.