question

Ben-4201 avatar image
0 Votes"
Ben-4201 asked LimitlessTechnology-0326 answered

Hosting an ASPNET project on a LiquidWeb server

Hello everyone,

I have created a basic ASPNET application and it works just fine locally. I am attempting to publish this to LiquidWeb on a windows server there. I have tried directly publishing through the visual studio IDE, manually creating a folder using dotnet publish and most recently, I created a fully self-contained folder using dotnet publish -r win7-x64.

Publishing manually and with the built in tool and then going to the website both display a runtime error

HTTP Error 500.31 - Failed to load ASP.NET Core runtime
Common solutions to this issue: The specified version of
Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Troubleshooting steps: Check the system event log for error messages
Enable logging the application process' stdout messages Attach a
debugger to the application process and inspect

Publishing it manually with the fully self-contained command does not. It instead displays the current index.html page and I feel part of that is the pathing here. The fully self contained path is something like website/publish/(Here is the project exe), while the index.html page lives under the website/ portion of the Url. I am looking for tips or tricks or ideas here on how to proceed.

windows-server
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This error usually indicates the target runtime is not installed on the server. Run dotnet --info on the server and make sure the target framework is installed.

Also see the troubleshooting guide.

https://docs.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-6.0#50031-ancm-failed-to-find-native-dependencies




0 Votes 0 ·

Ok thank you, I will attempt this. Quick question then, does this mean that a fully self contained executable does not contain the runtime needed?

https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained

0 Votes 0 ·

1 Answer

LimitlessTechnology-0326 avatar image
0 Votes"
LimitlessTechnology-0326 answered

Hi Ben,

Thank you for posting your question here and we are happy to help you regarding hosting your ASP .Net application.

Based on the error message you have mentioned above, I believe you are using Dot CORE version. And to deploy any code application, you have to install the "Hosting bundle" provided by Microsoft. This will take care of all required Installable for running your application.

Please refer following link for additional information and kindly feel free to get back for any additional queries.

https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-6.0&tabs=visual-studio

Install the .NET Core Hosting Bundle on your machine or IIS server where you are trying to host. The bundle installs the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module allows ASP.NET Core apps to run behind IIS.

https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer

Run the installer on the IIS server.

Restart the server or execute net stop was /y followed by net start w3svc in a command shell.

Besides, here's a document about deploying .NET Core application.

.NET Core application deployment - https://docs.microsoft.com/en-us/dotnet/core/deploying/

Hope it could be helpful.



--If the reply is helpful, please Upvote and Accept as answer.--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.