How to Upload Visual Studio Project Smarterasp
This article contains the most item steps for publish ASP.Internet Core spider web application to our web server using Visual Studio 2017.
1. Initial Setup at SmarterASP.net
Create a website and a SQL Server database from your hosting control panel. For more details, please check beneath links
1. Create a website, delight click here
2. Create a database, please click here
In a department following we will review some of the detail of the setup in order to get the values need to publish the project
2. Creating the Visual Studio Project
Build the project using the Visual Studio templates:
Annotation that, 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 projection 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 user identity. These tin exist seen past viewing the "localdb" in the VS SQL Server Explorer.
Data in VS project (left) and tables in SQL Server (right) created by Individual User Account potency.
Information technology is not a requirement to apply individual user accounts, notwithstanding if the project does not, it will exist 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 Packet Manager Panel in club to demonstrate the steps involving the database.
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 information technology is useful to collect these in advance.
Particular | Typical Value |
1 Server | https://<user>-001-site1.atempurl.com:8172/msdeploy.axd?site=<user>-001-site1 i.due east. https://demo-001-site1.atempurl.com:8172/MsDeploy.axd?site=demo-001-site1 |
2 Site Proper name | <user>-001-site1 i.e. demo-001-site1 |
three User Name | <user>-001 i.e. demo-001 |
iv Password | ********** |
5 Destination URL | http://<user>-001-site1.atempurl.com/ i.eastward. demo-001-site1.atempurl.com |
half-dozen Database Connection Cord | Data Source=SQL5040.site4now.cyberspace;Initial Catalog=****;User Id=****;Countersign=****; |
For more details on how to find some of this data please click hither
The database connectedness string can be found by selecting the "Databases" icon from your Control Console, and then the "Connection String Examples". Employ the selection titled "ASP.NET".
Note that this string includes the user name and countersign credential for the database (non to be confused with those of the site.) Your user name will exist shown correctly merely yous volition need to fill in your password.
Database Connection String: The database connection that will exist used after the site is published. Annotation 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 delight click here
4.Publishing the Projection
Right-click on the projection name in the VS Solution Explorer and select Publish from the context menu.
In that location are various target options; use "IIS, FTP, etc." which is for Spider web Deploy. Select the Create Profile push button.
This will showtime a new contour named "CustomProfile". (You lot can rename it later.)
On the first screen, fix:
- Publish Method: Web Deploy
Use the values nerveless in the previous section, keyed by thee numbered boxes, to fill in the fields.
Check the Salvage Countersign checkbox.
Afterward completing the showtime screen, select the Validate Connection push button to confirm that information technology is working before continuing.
Printing the Next button to become to the 2d screen.
On the second screen, have default values:
- Configuration: Release
- Target Framework: netcoreapp2.1
- Deployment Style: Framework-Dependent Note: you can cull 'Self-Independent' if the core version is withal not installed to the server.
- Target Runtime: Portable
Expand the lists on the second screen and check all of the boxes on both screens. Annotation that VS may fill in the database field(s) with the local connectedness. This is incorrect; both the Databases and the Entity Framework Migrations text fields should contain the path to the database on the server.as captured in the number 6 box above.
Select the Save push to complete the profile and return to the main screen.
Use the Publish button to publish the site to your business relationship
In one case you take created a profile you lot tin can reuse it every time that you publish by simply running the Publish control.
Observer the Output window in VS to encounter if the publication worked properly.
Note: If you get a message that "ERROR_CERTIFICATION_VALIDATION_FAILED" select the Configure link and re-run the Validate Connection command on the first screen. Then save, and run the Publish command over again.
Source: https://www.smarterasp.net/support/kb/a1910/how-to-publish-asp_net-core-web-application-via-visual-studio-2017.aspx
0 Response to "How to Upload Visual Studio Project Smarterasp"
Postar um comentário