zoukankan      html  css  js  c++  java
  • 如何解决Visual Studio 2005 "The Directory Name is Invaild" 错误

    今天用vs2005 做一个web 程序时发现当试图更改控件ID时,总是出现"The Directory Name is Invaild" 错误提示。

    以前曾遇到一次,忘了如何解决了。于是上网搜了搜发现在codeproject上一个老外也遇到同样问题,这是他的解决方法。
    http://www.codeproject.com/useritems/VsPropRenameBug.asp

    Workaround

    1. Navigate to the directory
    ..\Documents and Settings\<%UserName%>\Local Settings\Application Data\Microsoft\WebsiteCache

    2. Create a folder with the same name as the name of your project

    看到WebsiteCache ,突然想起上次如何解决这个问题。

    1. 按上面路径找到WebsiteCache 目录
    2. 打开Websites.xml文件,内容类似如下:

    <?xml version="1.0" encoding="utf-16"?>
    <DesignTimeData>
      
    <Website RootUrl="http://Localhost/net2005test1/" CacheFolder="net2005test1" startpage="Default.aspx" addnewitemlang="Visual C#" addnewitemoptions="2" startaction="1" _LastAccess="10/18/2006 9:02:49 AM"/>
      
    <Website RootUrl="http://Localhost/CssAdaptersTutorial/" CacheFolder="CssAdaptersTutorial" addnewitemlang="Visual C#" _LastAccess="11/1/2006 2:04:34 PM"/>
     
    </DesignTimeData>
    3.删除有问题的website标记段
    4.重新打开web程序在vs2005, 控件id可以更改,问题解决。

    写道这里突然想到应到微软bug report查查, 果然是bug。会在vs下一版本或service pack里解决。
    避免错误的方法就是不要同时用vs2005打开多个web程序,否则他们的cache 就晕了


    http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101992

    This problem should only occur if you have multiple instances of the Visual Studio IDE open at the same time and then close one. You can avoid this problem by only having one instance open at a time.

    A fix has been created for this bug. The fix will be in the next version of Visual Studio or possibly in a service pack. If this bug is significantly impacting your development you should contact Microsoft Product Support to request a hot fix.

    Microsoft Web Development Tools Team

    Posted by Microsoft on 2/15/2006 at 2:30 PM
    Clarification for user comments:

    The underlying problem is that if the WebSiteCache directory for a specific web site is deleted this problem will occur. Once the directory is deleted it will continue to occur even if you reboot the machine.

    There is a bug in Visual studio that when you have more than one instance of the IDE open and close a web-site it will delete the WebSiteCache directory of other web-sites. This is the common way to get into this situation. However, you could also get into the situation by deleting the directory manually (per the repro steps of this bug report.)

    The quick fix is to make VS re-build the web site cache:
    a) shut down all instances of VS
    b) remove cache from command prompt> rd /s /q "%userprofile%\Local Settings\Application Data\Microsoft\WebsiteCache"
    c) re-open your web site and the cache will be re-created

    An alternative method to fix the one web site without deleteing the entire cache is the following:
    a) shut down all instances of VS
    b) open "%userprofile%\Local Settings\Application Data\Microsoft\WebsiteCache\websites.xml"
    c) locate the entry for your web site and get its CacheFolder name. Usually the name of the web.
    d) Ensure a sub-directory of that name exists under "%userprofile%\Local Settings\Application Data\Microsoft\WebsiteCache\"

  • 相关阅读:
    学习OSGI---建项目,运行配置
    MongoDB 安装
    利用 ^ 异或运算符 进行交换(不需要第三方变量)
    2019HDU暑期多校训练-1004equation-方程求解
    HDU 4417-Super Mario-线段树+离线
    HDU 3333-Turing Tree-线段树+离散+离线
    POJ 2528-Mayor's posters-线段树+离散化
    POJ 2631-Roads in the North-树的直径
    POJ 2299-Ultra-QuickSort-线段树的两种建树方式
    noip2009最优贸易——spfa
  • 原文地址:https://www.cnblogs.com/patrick/p/561227.html
Copyright © 2011-2022 走看看