Steps to Deploy .NET core application on Visual Studio
Posted on July 27th, 2024
1)Open Visual Studio, Click Build→Publish “Project name”, in our case, the project name is “Hello World”
2) Enter the Hostname “PleskXXXX.is.cc” and Plesk account username and Password.
(Note : XXXX should be replaced with your actual Hostname)
3) Enter the Domain name in the “Site Name” and “Destination URL” field and click” Validate Connection”. A Green Tick icon will appear when the settings are valid and then click “Next”.
4) Alternatively, You can deploy the website with “FTP Publish Method”. Enter the Plesk account username and Password login details and click “Validate Connection” and then
Click “Next”.
5) Choose the Target Framework version and in Deployment mode you can either choose “Framework — Dependent” Or “Self-Contained”
i) In Frame Work Dependent, The target system will have Dot Net Core libraries installed and will be able to deploy own code.
Ii) In Self Contained option, The output publishing folder contains all components of the app, including the Dot NET Core libraries and target runtime, and does not depend upon the server components.
6) Click “save” and the website is ready to deploy
7) Click “Publish” and on the bottom you will see “Web App was published successfully”
Troubleshooting Steps :
To enable debug mode for the error in your application, please follow the steps below:
1. Navigate to the site’s deployment folder on the hosting system.
2. If the logs’ folder isn’t present, create the folder. For instructions on how to enable MS Build to create the logs’ folder in the deployment automatically, see the Directory structure topic.
3. Edit the web.config file. Set stdoutLogEnabled to true and change the stdoutLogFile path to
point to the logs’ folder (for example,.\logs\stdout). Stdout in the path is the log file name prefix.
A timestamp, process ID, and file extension are added automatically when the log is created.
Using stdout as the file name prefix, a typical log file is named vstdout_20180205184032_5412.log.
4. Save the updated web.config file.
The logs’ folder will need Read/Write permission to generate the logs. To enable permission for the log folder
i) Login to Plesk → File manager →website directory →select the logs’ folder →change permission.
ii ) Select “Application pool group (IWPG_sysuser_a)” (Note : the application pool user will be a different name on your account )
iii) Check the Modify/write option and click “Save”
5. Make a request to the app.
6. Navigate to the logs’ folder. Find and open the most recent stdout log.
7. Study the log for errors.
If you receive “Error_user_unauthorized” while deploying on Visual Studio as seen in the screenshot below, Please reset FTP password and try again.
To reset FTP password:
1) Login to Plesk →domain name →FTP access
2) Click the FTP username →enter new password and click “Ok/apply”. Once password is reset, please try to deploy again.
We do support Latest .NET core LTS versions. Please find the supported versions on the server below.
If you have any questions, feel free to contact us.