ASP.NET Deployment problem to IIS

Aurelio 0 Reputation points
2023-05-13T14:53:22.7233333+00:00

I am trying to publish an asp.net core 7 web API (the same with blazor) to a windows server IIS on a brand new W11 machine. I have:

installed the core 7 windows hosting bundle and runtime

grant permession on

I gave edit permissions on the site folder to the users IIS AppPool\myappurl.com, IIS_IUSRS and IUSR

Installed visualstudio 2022 comuniti edition with 6 and 7 runtime and hosting NET module

installed reweriteurl

installed IIS wituouth WEBDAV

but got an internal server error (500) when I try to display it on the browser.

I have set the stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" but no log in inetpub is show... nor in the c:\logs (with permission for IIS)

if I run dotnet myapp.dll the application start normally (but not in the browser)

if I run a sample hello world pure html the IIS work fine showing the app in the brower (with the same https certificate)

I have tried with servere minimal sample application from visual studio... all go well in in the IDE but not work with IIS deployment

i think my problem is the same described here

https://stackoverflow.com/questions/60217112/blazor-hosted-asp-net-http-error-500-19-internal-server-error

but that not work for me.

What could be the problem? How can I solve this?

thanks in advance

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,283 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Konstantinos Passadis 17,376 Reputation points MVP
    2023-05-14T15:04:59.88+00:00

    Hello @Aurelio !

    Welcome to Microsoft QnA!

    I see you are having trouble with deploying your ASP.NET Core 7 application to IIS

    Possible steps to troubleshoot :

    Check Event Viewer: Windows Event Viewer may have more details about the error. Check under 'Windows Logs' > 'Application' for any error messages related to IIS, .NET Core, or your application.

    Check IIS logs: IIS logs can also provide helpful information. By default, they're located in the %SystemDrive%\inetpub\logs\LogFiles directory.

    Check .NET Core version: Make sure that the .NET Core version on your development machine matches the version on your IIS server. Also, check that the correct version is specified in your project file (.csproj).

    Check web.config file: Make sure that the ASP.NET Core Module is correctly configured in your web.config file. The processPath attribute should be set to dotnet, the arguments attribute should point to your .dll file, and the stdoutLogEnabled attribute should be set to true to enable logging.

    Check application pool: Make sure the application pool for your site is set to 'No Managed Code'. ASP.NET Core runs in a separate process and manages the runtime. IIS is used only as a reverse proxy for requests.

    1. Permissions: Double check the permissions for the IIS_IUSRS and IUSR users on your application's folder. These users need read and execute permissions.
    2. Consider using the ASP.NET Core Module Log: To help diagnose issues with the ASP.NET Core Module, you can enable additional logging. Here is how to do it: Enable stdout logging

    The answer or portions of it may have been assisted by AI Source: ChatGPT Subscription

    Kindly mark the answer as Accepted and Upvote in case it helped or post your feedback to help !

    Regards

    0 comments No comments