Error connecting to undo manager of souce file

在调试Web Application时,经常弹出如下的提示
Error connecting to undo manager of souce file_第1张图片

我使用的版本是Visual Studio 2008,机器是XP SP2
这个问题只针对aspx生成的designer文件,其他文件不会产生这个提示。
对Web Site类型的项目也没有影响,因为Web Site没有自动生成的designer文件

在网上找了一下,发现这个问题还比较常见,自VS2003以来,这个问题就一直存在。
MS didn't fix this issue for years

《ASP.NET 高级编程》的作者在他的博客中有个解决办法,地址是http://www.hanselman.com/blog/ErrorConnectingToUndoManagerOfSourceFileQuotwhateverDesignerquot.aspx
This error is more than a little irritating, especially considering this is Visual Studio 2005 SP1. I'm getting this, now, for one file, every time I run my application.

Microsoft Visual Studio

The way I "fixed" it was to exclude the file from the Web Application Project, recompile, then re-include, the recompiles.

Seems to me that the error handler that threw this message box should spend more time fixing the problem automatically and less time informing me of a problem I can do little about. Maybe that's just me

作者提出的办法是,从当前的Web项目中排除这个文件,重新编译,重新把它加入到项目中,再编译。

MSDN论坛中,也有相应的解决办法 MSDN论坛的讨论地址是 http://social.msdn.microsoft.com/forums/en-US/csharpide/thread/79e84cfe-3d4b-43c7-8d86-723208e4a64c/
A simpler two-step fix is to:
1) Right-click the designer file and select delete
2) Right-click the aspx file and select Convert to Web Application
I get this frequently too, and I think it stems from some sequence of editing the aspx file while the app is running in debug
右击这个designer 文件,删除。右击aspx文件,选择转换为Web应用程序,重新生成designer 文件

还有一个老兄提供的办法,把aspx文件从项目中移除,然后再加进来 
I too was having this issue. I was using VS 2005 with the web project add-in. I found that if I excluded the offending aspx file from the project, then added it back in, the error disappeared
有朋友提到的,重启新动IDE的方法。quitting the IDE and restarting it is enough to fix.

如果移除aspx文件后再加入也不能解决这个问题,错误提示依然存在。需要注意操作顺序,
先移除,然后编译项目,如果编译成功,再把移除的文件加入。

如果移除后,不能编译怎么办呢?这个问题比较少见。一般aspx对应的后置代码类不是用new运算符号来直接调用,除非你把代码直接写在aspx文件中,移除后会因为找不到相关的代码而无法编译。

又一个办法
1. Shut down Visual Studio
2. Reset IIS or kill the asp.net worker process - whichever you prefer
3. Go to <ROOT>:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files (in WinXP) and delete those files. If you can't delete the files, kill whichever process is using them (I use SysInternals Process Explorer for that job)
4. Restart your project and then rebuild
关闭VS IDE,重启IIS和杀死asp.net 工作进程(aspnet_wp.exe或w3_wp.exe),
删除与当前项目相关的临时文件,重新编译

如果还不行,尝试删除IE缓存的  clearing IE cache (Internet Options > Delete Files)
有这么多办法,估计可以解决遇到的大部分情况,记录下来供大家参考。

你可能感兴趣的:(connect)