IT story

MVC4 HTTP 오류 403.14-금지됨

hot-time 2020. 9. 8. 22:00
반응형

MVC4 HTTP 오류 403.14-금지됨


로컬에서 제대로 작동하는 .net4.5 ASP.NET MVC4 웹 앱 (IIS Express 및 개발 서버)을 빌드했지만 웹 서버에 배포하면 403 오류가 발생합니다. 나는 서버에 .Net 4.5RC를 설치했고 aspnet_regiis -i모든 사람들이 이전 버전의 MVC / .Net에 대한 문제에 대해 권장 비트를 시도했지만 도움이되지 않았습니다.

어떤 아이디어?

편집 : 상황에 대한 추가 정보. 서버는 32 비트이고 잘 작동하는 다른 4 개의 MVC3 응용 프로그램이 있습니다. 작동하지 않는 것은 MVC4 앱뿐입니다.


시험

<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/> 
 </system.webServer>

통하다

https://serverfault.com/questions/405395/unable-to-get-anything-except-403-from-a-net-4-5-website


오류 403.14는 디렉터리의 내용을 나열 할 수없는 HTTP 오류 코드입니다. 확인하십시오

  1. 웹 사이트를 IIS에서 응용 프로그램으로 설정했습니다.
  2. 서버에 .NET 4.5가 설치되어 있습니다.
  3. .NET 프레임 워크의 적절한 버전을 실행하도록 응용 프로그램 풀을 설정했습니다 (예 : .NET 2.0으로 설정되지 않음).
  4. 애플리케이션 풀에서 통합 파이프 라인을 사용하고 있습니다.
  5. .NET 4.5는 실제로 IIS에 등록되어 있습니다. 유사한 문제 / 해결 방법 이 게시물참조하십시오.

일반적으로 a와 d는 IIS에 대한 MVC 배포와 관련된 가장 큰 문제입니다.


아마도 ... 게시 마법사를 사용하고 (저와 마찬가지로) "게시 중 미리 컴파일"확인란을 선택하고 (저와 마찬가지로) 동일한 증상이 나타나는 경우 ...

예, 저는 머리를 쓰다듬었지만이 확인란을 선택 취소하면 관련없는 설정 인 것처럼 보이며 설명 된 모든 증상이 재배치 후에 사라집니다.

바라건대 이것은 일부 사람들을 수정합니다.


Windows-> 시작-> widows 기능 켜기 및 끄기

필수 옵션을 확인하십시오.

여기에 이미지 설명 입력


신청하기 전에

runAllManagedModulesForAllRequests="true"/>

덜 과감한 대안을 제안하는 아래 링크를 고려하십시오. 게시물에서 저자는 로컬 web.config에 다음과 같은 변경 사항을 제공합니다.

  <system.webServer>
    <modules>
    <remove name="UrlRoutingModule-4.0" />
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
    </modules>

http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html


내 RouteConfig.cs에있는 url 매개 변수 의 리터럴 문자열내에서 "id"의 이름을 잘못 변경 한 Visual Studio 2012 리 팩터-> 이름 바꾸기 버그있습니다. 이로 인해 Windows Server 2012 및 Windows Server 2008 R2 모두에서 새롭고 올바른 설정에서 403.14가 발생했습니다.

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

변경되었습니다

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{renamed_text}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

You can also get a 403 if when testing with dev server you are using integrated pipeline and then install as classic pipeline mode on your live IIS 7.5 web server, also I was missing my app_data folder which also was required


If you're running IIS 8.5 on Windows 8, or Server 2012, you might find that running mvc 4/5 (.net 4.5) doesn't work in a virtual directory. If you create a local host entry in the host file to point back to your local machine and then point a new local IIS website to that folder (with the matching host header entry) you'll find it works then.


<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/> 
 </system.webServer>

U can use above code


I had set the new app's application pool to the DefaultAppPool in IIS which obviously is using the Classic pipeline with .NET v.2.0.

To solve the problem I created a new App Pool using the Integrated pipeline and .NET v4.0. just for this new application and then everything started working as expected.

Don't forget to assign this new app pool to the application. Select the application in IIS, click Basic Settings and then pick the new app pool for the app.


the one i see more frequently recently is IIS and allowing 32bit applications to run

Is this what you have tried. otherwise we need more information about production and dev server versions


I have a bit different issue, on server 2012 somehow i forgot to enable asp.net 4.5 so if you have this issue, double check that you enable it.


I'm running Windows Server 2012 R2 on Azure and ASP.NET 4.5, IIS 8

I solved this problem by uninstalling all of the ASP.NET items in Programs and Features, then reinstalling ASP.NET like this with Server Manager using Add Roles and Features: picked Role-Based or Feature-Based installation, picked my server, and then for Select Server Role picked Web Server (IIS)/Web Server/Application Development, then clicked ASP.NET 4.5, confirmed installation of a prerequisite, and then reinstalled ASP.NET 4.5.

My previous searches had lead me to believe that the problem actually stems from a registration problem with ASP.NET. With earlier versions of ASP.NET, there is actually a utility that you can run to register ASP.NET without reinstalling, but that doesn't seem to be available any longer.


I solve the problem opening the visual studio, expanding the references and changing the property "Copy Local" to "True".

I discover this comparing the dlls of the old version with the Dlls of my new version (that was not working)


In my case, my application's default page was index.html which was missing from the default document options. Adding it fixed the 403.14 Forbidden error.


In my case the issue was caused by custom ActionFilterAttribute which was a kind of global filter attribute. The attribute instantiated a service through Autofac but the service crashed in constructor:

public ActionFilterAttribute()
{
    _service = ContainerManager.Resolve<IService>();
}

public class Service: IService
{ 
    public Service()
    {
        throw new Exception('Oops!');
    }
}

In my case neither Windows Features nor aspnet_regiis -i didn't do the work. After hours of digging in the Internet, I made my own solution:

  1. In the IIS Manager in Modules I changed inherit to local in UrlRoutingModule-4.0 node:

    여기에 이미지 설명 입력

  2. web.config에서이 포럼의 몇 가지 팁을 혼합하여 붙여 넣었습니다.

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="UrlRoutingModule-4.0"></remove>
            <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""></add>
        </modules>
    </system.webServer>
    

도움이되기를 바랍니다.

참고 URL : https://stackoverflow.com/questions/11425574/mvc4-http-error-403-14-forbidden

반응형