• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Please help an absolute newbie publish a .NET Core application to Plesk

alexander.hoffen

New Pleskian
Hi!

After countless of hours spent googling, I really need some help to understand how publishing a website works. Bear with me -- I know how to code, but this is my first time actually publishing something. Perhaps I'm just stupid, and am unable to understand the online guides, but I think I'm almost there.

I have a Plesk server at one of the big hosting websites. It's a windows server. They gave me a .publishsettings-file that contains the following xml (though naturally the parameters aren't blank):

Code:
<publishData><publishProfile profileName="" publishMethod="" publishUrl="" msdeploySite="" userName="" destinationAppUrl="" controlPanelLink=""/></publishData>

I right-clicked on my profile in Visual Studio, selected Publish, imported the file, and pressed the publish button. The result was that files were uploaded to Plesk server in the following structure:

d781e06b21199b7499e07fdf229035e2.png


The wwwroot-folder contains css, js, and images, but not html or cshtml. As a web developer, the first thing that confused me is the lack of cshtml-files, but I figured maybe they aren't needed because of how .NET handles dlls? Regardless, going to my website just gives me a "500 - Internal server error".

Can someone explain to me, as if I was an eight year-old, what exactly I need to do to get my website up and running. Should I change a publish-file to include my cshtml-files? Do I need to change some settings, either on the server or in VS? Do I need to change the project structure? I feel so lost, and neither the Plesk nor VS docs have been of much use to me.

I'm really sorry if this is a stupid question, and thank you very much for your patience.
 
Hello,

let's try to split this issue into several small problems and questions
1) to understand if problem is related to webdeploy, you can try to switch to local directory publishing in Visual Studio and compare content produced locally with content uploaded using publishsettings.
2) in case you have 500 error on your site, you can try to log in to your server (if it is possible), and request your page locally. In this case IIS will produce more detailed errors for your request. If you cannot open your site locally, you can try to add the following section in your web.config
<system.web>
<customErrors mode="Off" />
...
</system.web>
in this case you will see more information about error, which can help to understand root cause.

3) which version of .NET Core are you using? starting from ASP.NET Core 2.2 new model of IIS integration is used, and in order to make it work, you need either:
a) to have IIS application pool switched into 64-bit mode. Unfortunately, you cannot do this in Plesk Onyx 17.8 (this functionality was added in Plesk Obsidian 18.0 which is currently RC). But you can change this manually in IIS (again, if you have access to the server).
b) configure your application to not use new integration with IIS for your 2.2 application
some details about this you can read in this thread: Question - ANCM In-Process Handler Load Failure on asp.net core 2.2 app

I hope this can help you.
 
Back
Top