0

i have dedicated server.after I install iis in windows server 2008.i test my server with html page and it work fine.but when I put my mvc4 razor project it give this error.why??

500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Login", action = "LoginUser", id = UrlParameter.Optional }
            );
}
**//Webconfig**
    <configuration>
      <appSettings>
        <add key="webpages:Version" value="2.0.0.0"/>
        <add key="webpages:Enabled" value="true"/>
        <add key="PreserveLoginUrl" value="true"/>
        <add key="ClientValidationEnabled" value="false"/>
        <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
      </appSettings>
      <system.web>
        <customErrors mode="Off" defaultRedirect="~/Shared/ErrorPage"/>
        <sessionState timeout="20"/>
        <compilation targetFramework="4.0"/>
          <authentication mode="Forms"></authentication>
        <pages>
          <namespaces>
            <add namespace="System.Web.Helpers"/>
            <add namespace="System.Web.Mvc"/>
            <add namespace="System.Web.Mvc.Ajax"/>
            <add namespace="System.Web.Mvc.Html"/>
            <add namespace="System.Web.Routing"/>
            <add namespace="System.Web.WebPages"/>
          </namespaces>
        </pages>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true"/>
            <handlers>
            <remove name="UrlRoutingModule-4.0" />
            <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
                <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
                <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
                <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
                <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
               <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
               <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
            </handlers>
      </system.webServer>
   </configuration>
James
  • 2,171
  • 1
  • 16
  • 22
Vahid Akbari
  • 169
  • 6
  • 23
  • It's hard to say... You get a 500 error, so your application is working, but it generates an error. Can you post the code in your LoginUser action in the Login controller, and maybe the code in the LoginUSer view? I suspect there is an error there. – Céryl Wiltink Jan 27 '14 at 09:18
  • Maybe you can set 'Send Errors To Browser' to true in IIS? And maybe remove the DefaultRedirect from Custom errors in your web.config. That should give a better error-message. – Céryl Wiltink Jan 27 '14 at 09:30
  • I do that it still give this error – Vahid Akbari Jan 27 '14 at 09:45
  • 1
    Okay, can you maybe first try some options listed in this question: http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error To be sure what is wrong we need the actual error message. This is just a general error message. If you try the options in the link and you get a more detailed error message, post that here. – Céryl Wiltink Jan 27 '14 at 09:51
  • ANd in addition to the options in the link, make sure you are not catching the error message in Application_Error() in the Global.Asax file – Céryl Wiltink Jan 27 '14 at 09:53
  • this is the error:HTTP Error 500.21 - Internal Server Error Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list – Vahid Akbari Jan 27 '14 at 10:07
  • 1
    There you go, that is the real error message! Unfortunately, I dont know how to fix that error specifically, but searching for that error should give plenty of possible solutions! (This one is just the first I found, not sure if it applies to you, bet here you go: http://stackoverflow.com/questions/13162545/handler-extensionlessurlhandler-integrated-4-0-has-a-bad-module-managedpipeli) – Céryl Wiltink Jan 27 '14 at 10:09
  • this the answer in this post : http://stackoverflow.com/questions/13162545/handler-extensionlessurlhandler-integrated-4-0-has-a-bad-module-managedpipeli – Vahid Akbari Aug 28 '16 at 13:32

0 Answers0