0

I have an ASP.NET 3.1 project that get published to a windows server. When I run the project locally on my computer, it works fine; however, when I remote desktop into that windows server, I am getting a 500 error in the network tab and the following error:

enter image description here

I have changed my environment variable to Development in my Launch.json file, but still received the same error

 "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }

When I looked in windows Event Viewer, I found this error: enter image description here Can someone help me figure out what is going on with this?

Hussam Ahmed
  • 413
  • 1
  • 5
  • 17
  • No one can help much unless they can touch your code base, https://github.com/dotnet/SqlClient/wiki/Frequently-Asked-Questions#11-why-do-i-get-a-platformnotsupported-exception-when-my-application-hits-a-sqlclient-method – Lex Li Oct 15 '20 at 21:48

1 Answers1

0

Please check the value of ASPNETCORE_ENVIRONMENT variable. You will have to set this environment variable to "Production"(or other environment than Development).

Otherwise, you can update web.config like this:

<configuration>
 <system.webServer>
    <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\Application.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
        <environmentVariables>
            <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
        </environmentVariables>
    </aspNetCore>
 </system.webServer>
</configuration>

Refer this post for more details.

samwu
  • 3,857
  • 3
  • 11
  • 25