您的位置:首页 > 其它

VS.net 2003 打开Web项目失败的解决方法

2007-01-19 15:21 1141 查看
几个月前我打开一个Web项目,VS 2003居然告诉我以下信息:

Refreshing the project failed. Unable to
retrieve folder information from the server


不过还是可以打开Web项目的.既然可以打开我也没太多注意.

过了一段时间后,这个项目居然打不开了,除了上面的信息外,还告诉我以下的信息:

Unable
to get the project file from the web server


奇怪了.但是一时也没有解决掉.

今天下了决心,要将之消灭:

上网找了一下,找到了几种方法.总结一下:

[b]方法1:找到工程目录下以点开头文件夹(c:\.folder),删除此文件夹,因为你用VSS或者subversionCMS的话,也有可能产生以点开头文件夹[/b][b].[/b]

对于SVN以"."开头的话,将它改为"_"开头,也许能解决问题。

[b]方法2:找到你机器用户下面的VSWebCache目录,例如C:\Documents and Settings\<user>
\VSWebCache.
删除下面你的Web项目对应的文件夹[/b][b].[/b]

但是用了上面的2种方法还是不行.

突然发现另外一种方法.

[b]方法3:直接将你的Web项目文件copyC:\Documents and Settings\<user>
\VSWebCache
对应的文件下[/b]

居然行了,什么原因,我不知道,要知道的话,就只能问问微软VS2003是如何启动Web项目.看起来象是VS2003创建Web项目时也做了一个Cache.

如果你打开Web项目时预见IIS拒绝访问,你可能最先想到的是IIS启动了没有,但是有的时候即使你启动了还是出现同样的错误,怎么办?可以想想以前是不是突然死机或者非法操作,如果是的话,按上面的提供的3种方法试一下,如果还是不行,检查一下IIS日志文件,在系统文件下的Logfiles,例如C:\windows\system32\logfiles,你会发现每天都有记录,检查出现此错误那天的日志文件,看看里面有没有

异常,如果有乱码或者什么,删除它,或者干脆把整个文件删除.

再重新打开项目,可能就好了.

好了,这是第4种方法.

[b]方法4:修改或删除日志文件(C:\windows\system32\logfiles),因为日志文件记录了不正常的数据[/b][b].[/b]

如果还有其他方法,可以提出来.

注:感谢我的同事Jack Zhu,第4种方法是提出来的..

Visual
Studio .Net 2003 Error: "Refreshing the project failed. Unable to retrieve
folder information from the server."

If you look up this error, some sites will tell you that it has to do with
Visual Source Safe and/or a “.” prefixing a folder name.

I have visual source safe installed, but I was not using it on the particular
project I was working on. I looked and I didn't have any folders with a “.”
prefix (i.e. “.foobar”) contained in the project that was causing the error.

Visual Studio creates a VSWebCache Folder under “C:\Documents and
Settings\ username ”. Find this folder and delete it. Yes, the entire
folder. It's purpose is to cache folder structures (and some files) so that
Visual Studio can load projects faster. It recreates itself on the next opening
of a project and the error goes away. No harm done.

Make sure Visual Studio .NET is not open.

Navigate to Your Projects Folder (all of the places you keep projects). The
two most likely places are “C:\Inetpub\wwwroot” and “C:\Documents and
Settings\ username \My Documents\Visual Studio Projects“.

Enable the option to view Hidden Files and Folders. “Tools, Folder
Options..., View (tab), Show hidden files and folders (click next to it), OK
(click).“

This is the fun part, and likely to take some time. Look through all of
your projects and rename any folders in projects that have names that start with
“.“ (period).

Navigate to your “Documents and Settings“ folder (most likely C:\Documents
and Settings) and open the folder for your username (i.e. Robz).

Find the Folder named “VSWebCache“ and delete it.

Reopen Visual Studio .NET and open a project.

Verify that the VSWebCache folder has been recreated in the same place it
was deleted from.

Disable the option to view Hidden Files and Folders (if you wish). Follow
the same steps as in 3, but click “Do not show hidden files and
folders”.

An alternative to steps 3,4, and 9 (and to save precious time) would
be to wait until the error comes back and then determine what projects are being
held in the VSWebCache folder and follow steps 3,4 and 9 for just those projects
in the VSWebCache. Then continue the instructions at step 5.


These instructions are for Windows XP. Directions for other OSes may differ
just slightly.

The most relevant information I found came from this post: P2P Wrox Forums. Special thanks to Richard Acton for pointing this out in his blog.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: