[英]I renamed form and forgot to save visual studio C# - How do I fix this error?
I renamed a form and forgot to save my Visual Studio Project.我重命名了一个表单并忘记保存我的 Visual Studio 项目。 Now I am getting this error:
The file does not support code parsing or generation because it is not contained within a project that supports code.
现在我收到此错误:
The file does not support code parsing or generation because it is not contained within a project that supports code.
I can still see the original form name and when I double click the specific form this is the error I get: the item does not exist it may have been moved, renamed, or deleted
我仍然可以看到原始表单名称,当我双击特定表单时,这是我得到的错误:
the item does not exist it may have been moved, renamed, or deleted
How do I fix my problem?如何解决我的问题? I just want access to the form I renamed and I am guessing the project is not reading for the new one (but unsaved) and is searching for the original which does not exist anymore.
我只想访问我重命名的表单,我猜该项目没有读取新表单(但未保存),并且正在搜索不再存在的原始表单。
Solved this problem from @KingOfArrows 's comment, but I may as well post it here.从@KingOfArrows 的评论中解决了这个问题,但我不妨把它贴在这里。 I was able to solve the issue by editing every instance of the old version in the.csproj file by:
我能够通过编辑 .csproj 文件中旧版本的每个实例来解决该问题:
unload project
in the solution viewerunload project
edit project file
(if it hadn't already appeared automatically), and then changing every reference of the old name to the new name in the textedit project file
(如果它尚未自动出现),然后将旧名称的每个引用更改为文本中的新名称reload project
, causing everything to work properly.reload project
,从而使一切正常工作。 I hope this helps anyone if they run into the same issue.如果遇到同样的问题,我希望这对任何人都有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.