가끔 내 MVC4 웹 응용 프로그램을 빌드하고 시작한 후에이 오류가 발생합니다. 다시 작성한 후에 사라질 수 있습니다. Windows Azure에 게시 한 후 동일한 문제가 발생했습니다.'System.Web.Optimization.StyleBundle'유형을로드 할 수 없습니다.
누구든지이 오류를 해결하는 방법을 알고 있습니까?
Server Error in '/' Application.
Could not load type 'System.Web.Optimization.StyleBundle' from assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
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.TypeLoadException: Could not load type 'System.Web.Optimization.StyleBundle' from assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
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:
[TypeLoadException: Could not load type 'System.Web.Optimization.StyleBundle' from assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
Inventarium.Web.Mobile.App.BundleConfig.RegisterBundles(BundleCollection bundles) in c:\dev\Inventarium\Inventarium.Web\Inventarium.Web.Mobile.App\App_Start\BundleConfig.cs:30
Inventarium.Web.Mobile.App.MvcApplication.Application_Start() in c:\dev\Inventarium\Inventarium.Web\Inventarium.Web.Mobile.App\Global.asax.cs:18
[HttpException (0x80004005): Could not load type 'System.Web.Optimization.StyleBundle' from assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4058245
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
[HttpException (0x80004005): Could not load type 'System.Web.Optimization.StyleBundle' from assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11703488
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4870277
UPD : 내가 직접 문제를 발견했습니다.
System.Web.Optimization.dll에 대한 잘못된 참조가 있었는데 제 웹 사이트가 이전 버전을 사용하려고했습니다. 패키지를 삭제 한 다음 다시 추가하면 매번 도움이되지 않습니다.
해결책은 모든 웹 사이트에서 이전 패키지, 참조 및 패키지 구성을 완전히 삭제 한 다음 다시 추가하는 것입니다.
희망이 있으면 도움이됩니다. 로마 니 키틴의 주석 사항에 따라
직접 문제가 발견되었습니다. System.Web.Optimization.dll에 대한 잘못된 참조가 있었는데 제 웹 사이트가 이전 버전을 사용하려고했습니다. 패키지를 삭제 한 다음 다시 추가하면 매번 도움이되지 않습니다. 해결책은 모든 웹 사이트에서 이전 패키지, 참조 및 패키지 구성을 완전히 삭제 한 다음 다시 추가하는 것입니다. 희망이 있으면 도움이됩니다. –
이 질문을 답이없는 것처럼 보이도록 대답으로 넣어주십시오. 자신의 답을 올바른 것으로 표시하십시오. –
답변으로 표시하여 대답하지 않은 목록에 표시되지 않도록하십시오. – SoftSan