我刚刚升级到Visual Studio 2013,并在发布我的 asp.net Webforms项目时发现了一个新的预编译和组合选项。
但是在发布到我的测试服务器时,ajax 控件工具包停止工作。
查看事件日志后,我发现以下内容:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2014-12-12 16:06:48
Event time (UTC): 2014-12-12 15:06:48
Event ID: de260aa337ee442d877e35615225da8d
Event sequence: 4
Event occurrence: 1
Event detail code: 0
....
Exception information:
Exception type: HttpException
Exception message: Directory 'E:...AppRootControlsView' does not exist. Failed to start monitoring file changes.
at System.Web.FileChangesMonitor.FindDirectoryMonitor(String dir, Boolean addIfNotFound, Boolean throwOnError)
at System.Web.FileChangesMonitor.StartMonitoringPath(String alias, FileChangeEventHandler callback, FileAttributesData& fad)
at System.Web.Caching.CacheDependency.Init(Boolean isPublic, String[] filenamesArg, String[] cachekeysArg, CacheDependency dependency, DateTime utcStart)
at System.Web.Hosting.MapPathBasedVirtualPathProvider.GetCacheDependency(String virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
at System.Web.ResponseDependencyList.CreateCacheDependency(CacheDependencyType dependencyType, CacheDependency dependency)
at System.Web.HttpResponse.CreateCacheDependencyForResponse()
at System.Web.HttpCachePolicy.UpdateFromDependencies(HttpResponse response)
at System.Web.HttpCachePolicy.UpdateCachedHeaders(HttpResponse response)
at System.Web.HttpCachePolicy.GetHeaders(ArrayList headers, HttpResponse response)
at System.Web.HttpResponse.UpdateNativeResponse(Boolean sendHeaders)
at System.Web.HttpRuntime.FinishRequestNotification(IIS7WorkerRequest wr, HttpContext context, RequestNotificationStatus& status)
Request information:
Request URL: http://.../Forms/Public/StartForm.aspx?_TSM_CombinedScripts_=True&v=P4sRFgGfV4Nfd4EZMC8du8QjF0BC31YW_Px8RQK42ys1&_TSM_Bundles_=&cdn=False
Request path: /Forms/Public/StartForm.aspx
User host address: X.X.X.X
User: {BFBFFDD1-...-4697-85E7-69A522272D6D}
Is authenticated: True
Authentication Type: Forms
Thread account name: IIS APPPOOLapp
问题是当我组合和预编译时没有生成目录~ControlsView
。我已经检查了我的 web.config,它没有引用~ControlsView
。
为什么此错误只发生在 ajax 控件工具包 javascript 参考中,我该如何解决这个错误?
我遇到了同样的错误。我找到了这个描述这个问题的德语页面(谷歌翻译在翻译它方面做得很好):
http://gehirnwindung.de/post/2010/01/18/ASPNET-Precompilation-und-die-Fehlermeldung-Directory-does-not-exist-Failed-to-start-monitoring-file-changes.aspx
解决方案很简单,只需在构建过程中创建缺少的目录即可。我刚刚在我的发布配置文件中添加了一个 MakeDir 行,问题就消失了。