Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"500 - Internal server error." on IIS app 4.0

Tags:

I made a simple asp.net web application that does nothing. It works using .net framework 2.0 (as do all the other applications on the server), but when I change it to .net framework 4.0 I get a "500 - Internal server error".

To change to 4.0, I compiled with .Net Framework 4.5.2 (also tried 4.0), and I changed the application pool in IIS to ASP 4.0 integrated.

I set web.config to display errors, but it's still only the vague error message above. I can see no errors or warnings in the system logs. I did register .net framework v4.0.30319.

What can cause this?

web.config:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation strict="false" explicit="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
    <customErrors mode="Off">
      <error statusCode="403" redirect="NoAccess.htm"/>
      <error statusCode="404" redirect="FileNotFound.htm"/>
    </customErrors>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>
</configuration>
like image 664
xpda Avatar asked Sep 08 '16 16:09

xpda


1 Answers

I'm assuming that you did not register .NET 4.0 installation Properly. you need to run in the cmd with following parameters "C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i"

Steps to Install this Command

1.Now you need to start command prompt by typing cmd at the Run command and then execute the command prompt with Administrator rights by right clicking and choosing Run as administrator from the context menu.

2.Then on the command prompt you need to navigate to the Directory that has the aspnet_regiis.exe file for that you need to type
CD C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ And then you need to type the following command and hit enter to register ASP.Net with IIS. aspnet_regiis -i

like image 70
Tummala Krishna Kishore Avatar answered Sep 22 '22 14:09

Tummala Krishna Kishore