Exception when VS 2010 ASP.NET Development Server Serves Static Files

送分小仙女□ 提交于 2019-12-25 16:51:49

问题


I'm building an ASP.NET MVC 2 site with Visual Studio 2010 Beta 2.

Out of nowhere none of my images or css started showing up. If I navigate directly to the resources in the browser I see this exception message:

Specified argument was out of the range of valid values. Parameter name: utcDate

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: utcDate]
System.Web.HttpCachePolicy.UtcSetLastModified(DateTime utcDate) +3038942
System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath) +1130 System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +347
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8683736 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Some Notes:

Already tried restarting vs 2010, closing all the webserver instances, restarting IIS.


回答1:


Fixed this by setting my computer's clock data way into the future, build the project in debug mode, and then moved the time back.

From googling around I found this is because your trying to load assemblies that were last modified in the future. Time travel coding basically.

The other problem I had was once I set the time into the future, my VS2010 evaluation period expired.


Lol, this was because of daylight savings time which I completely forgot about.



来源:https://stackoverflow.com/questions/1656487/exception-when-vs-2010-asp-net-development-server-serves-static-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!