IIS 7에서는 Nancy 프로젝트를 사용하여 웹 사이트를 만들었습니다. 그런 다음 별칭 api
을 사용하여 사이트에 MVC 2 응용 프로그램을 추가했습니다. Nancy 프로젝트에서 정의 된 경로를 완벽하게 방문 할 수 있습니다. 내가 /api
를 방문 할 때 그러나, 나는 다음과 같은 오류가 발생합니다 :IIS 7의 Nancy 사이트에 MVC 2 응용 프로그램 추가
Could not load type 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Could not load type 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Could not load type 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler'.]
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +11588073
System.Web.Configuration.HandlerFactoryCache.GetTypeWithAssert(String type) +47
System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +18
System.Web.Configuration.HandlerFactoryCache..ctor(String type) +27
System.Web.HttpApplication.GetFactory(String type) +95
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +352
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375
MVC 2 응용 프로그램이 요청을 처리하기 위해 NancyHttpRequestHandler를 사용하려고하는 것 같다. Nancy 응용 프로그램에 정의되지 않은 경로는 404 페이지를 표시하기 때문에이를 말합니다.
내가 시도 몇 가지 다음 MVC 2 응용 프로그램의 Web.config
으로
, 나는이 (가)
<system.web/>
블록에 다음과 같은 추가 : 낸시 응용 프로그램의Web.config
에<httpHandlers> <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </httpHandlers>
을, 나는 추가
<system.web/>
블록에 대한 다음 내용 :<httpHandlers> <add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" /> <remove verb="*" path="api/*" /> </httpHandlers>
두 응용 프로그램에서 모두
<system.webServer/>
및<system.serviceModel/>
블록의 설정을 사용해 보았습니다.
MVC 2 응용 프로그램이 IIS 7의 Nancy 사이트에 포함될 때 제대로 작동하도록하려면 어떻게해야합니까? 모든 지침은 크게 감사하겠습니다.
우수! 그냥 이것을 테스트하고 그것은 매력처럼 작동합니다. MVC3 작업을 지난 2 주간 낸시 (Nancy) 팀으로 이관하도록 설득 할 수만 있다면. :) 정보 주셔서 감사합니다. 건배! –