本文介绍了奇怪的“ Designer1.cs”创建的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Visual Studio如何将文件链接到其相应的designer.cs文件?我遇到了一个奇怪的情况,无论是DataSet设计器还是L2S DBML设计器都忽略了DataSet.Designer.cs,而是创建并使用了DataSet.Designer1.cs。我该如何切换回去?
How does visual studio link files to their corresponding designer.cs files? I have a strange situation that's occurred with both the DataSet designer and also the L2S DBML designer where it's ignoring the DataSet.Designer.cs and has created and used a DataSet.Designer1.cs instead. How can I switch it back?
推荐答案
感谢Zendar的建议,这就是我所做的:
Thanks to Zendar's suggestion, this is what I did:
- 关闭Visual Studio。
- 使用TortoiseSVN重命名
DataContext1.designer.cs
文件保存到DataContext.designer.cs
,因此重命名由源代码管理控制。 - 已打开
在Textpad中使用MyProject.csproj
。 - 执行搜索,并用<$替换
DataContext1.designer
c $ c> DataContext.designer (找到2个实例)。 - 保存并关闭。
- Close Visual Studio.
- Use TortoiseSVN to rename the
DataContext1.designer.cs
file toDataContext.designer.cs
, so the rename is picked up by source control. - Opened
MyProject.csproj
in Textpad. - Performed search and replace for
DataContext1.designer
withDataContext.designer
(found 2 instances). - Save and close.
在Visual Studio中重新打开并构建解决方案,确认此方法有效。感谢Zendar!
Re-opening and building the solution in Visual Studio confirmed this worked. Thanks Zendar!
这篇关于奇怪的“ Designer1.cs”创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!