Project has recently been doing, release deployment of things are made of a coworker or boss, but to experience of trying to remember everything, so things, it was my turn, because it is the first time issued a deployment project to a new server environment, will inevitably encounter all sorts of problems, sum up down, hope you can help people in need.

The framework of the project uses vue+.netCore2.2, so the front and back ends need to be released separately. There are a lot of problems encountered, but it is also a kind of experience for myself.

one 1.1 Modifying the Environment Configuration to the Database Address of the Online Server Modify the database configuration of the three JSON files in the website to the online database environment

1.2 Setting startup Options to Migrate databases Perform the following operations only for the migration tools already in the project

Set Migrator in the project as the startup project, and change the connection string of app.settings.json in the project to the IP address of the server, and the login name and password to the login name and password of the online database

If the tool is not available in the project, perform the following steps

1. Package Manager Console, Package Manager Console (PMC)

Get — help about_EntityFramework get — help about_EntityFramework Get — help about_EntityFramework get — help about_EntityFramework After entering the command, we should be able to see an arrogant Mustang avatar. Below the avatar is the related help document of EFcore, as shown below

You can also enter the add-migration migration name as prompted. Update-database After adding a migration file successfully, you can use this command to update the file to the database. The default value is all migrations. If you want to specify the migration file, add the name of the migration file. Update-database migrationName (migrationName); update-database migrationName (migrationName); update-database migrationName (migrationName); The Script- migration command is used to generate SQL statements corresponding to migration files. If no parameter is added to this command, all SQL statements corresponding to migration files are generated by default. Of course, you can also specify parameters according to the format

Remove-migration If you want to delete the last migration, you can use get-help to obtain the corresponding command document, such as get-help update-databa

1.3 Migrating database to Online F5 startup project, will pop up prompt whether to migrate database to online server address, enter “Y” to migrate database to the server

1.4 Publish local Projects Re-set the launch project to middleware.web. Host and click the publish button. Publish the project to a folder of your choice

At this point, the local. NetCore project release is complete

two Before deploying the Vue front-end, you need to modify remoteUrl and baseUrl in ipconfig. js to set the IP addresses of the front and back ends to the IP addresses of the server. Replace localhost with the IP address of the server

Release the VUE project terminal using the command line — After entering the command NPM run build and pressing enter, a dist folder will be generated in the local project directory

Open the local projects folder, locate the dist folder, and copy it. The local VUE project has been successfully published.

3. The distribution site copies the dist folder published in the front end and the folder published in the back end to the server. Open IIS and add front-end and back-end websites

Window+R Start the running program enter MSTSC open remote connection enter the remote desktop IP address and login name and password. The remote desktop connection is displayed.

Add a website: site name, physical path, change the port number to the port number corresponding to the front and back end projects.

Here. NetCore site application pool. The NET CLR version is being changed to unmanaged code

3.2 Modifying Permissions Click Folder right-click Properties — Security Settings Add permissions for Everyone and IIS_IUsr to allow all

NetCoreruntime and netCore Hosting are available for download

Dotnet.microsoft.com/download/do…

Install after download

3.4 Installing the VUE Environment Install the required vUE environment, urlrewrite, or URL redirection, to prevent the error that 404URL does not exist due to page refresh.

Four. 4.1 500.19 HTTP Error 500.19 – Internal Server Error The requested page could not be accessed because the related configuration data for the page was invalid.

Cause: The environment is not installed

Solution: Restart IIS and ensure that the required environments are installed on the front and back ends.

4.2 Dependency Error After Dotnet Core Runtime is installed in Windows, the secondary program cannot be started because the apI-ms-win-crt-runtime-L1-1-0.dll solution is lost

Dotnet core runtime depends on vc++2015. If vc++2015 is not installed on the system, this error is reported

Solution: download and install vc++2015 before installing dotnet core runtime

4.3 502.5 Process Fails

Cause: The background database is incorrectly configured or the environment is not installed.

Solutions:

NetCore web.config stdoutLogEnabled= “True”, then manually create logs folder, restart the website, logs folder will generate a TXT file, open the details of the error message. Change the configuration to the correct one.

Finally, remember that CMD runs iisreset to restart the IIS service for the configuration to take effect.

At this point, the process of publishing from local to a new server is complete. Have to sigh, feeling or masturbation code better, ha ha.

Experience, can be more profound process. So some things only their own hands to try, will remember more firmly, later encounter the same problem will be able to solve.