奇怪的“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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
感谢 Zendar 的建议,这就是我所做的:
DataContext1.designer.cs
文件重命名为DataContext.designer.cs
,以便源代码管理系统拾取重命名。MyProject.csproj
。DataContext1.designer
替换为DataContext.designer
(找到 2 个实例)。在 Visual Studio 中重新打开并构建解决方案证实了这一点。谢谢赞达尔!
Thanks to Zendar's suggestion, this is what I did:
DataContext1.designer.cs
file toDataContext.designer.cs
, so the rename is picked up by source control.MyProject.csproj
in Textpad.DataContext1.designer
withDataContext.designer
(found 2 instances).Re-opening and building the solution in Visual Studio confirmed this worked. Thanks Zendar!
相关文件的信息写入项目文件(*.csproj)中。这可能会解决问题:
替代方法是尝试更改*.csproj 文件中的信息,然后在出现的所有位置将 Designer1 重命名为 Designer。我没有尝试这个,但它可能会起作用。
Information about related files is written in project files (*.csproj). This may fix problem:
Alternative would be to try to change information in *.csproj file and then to rename Designer1 to Designer in all places it occurs. I did not try this, but it may work.
.csproj 文件中的
设置不正确。一旦更新,就不再为我生成额外的文件。<LastGenOutput>
was set improperly in the .csproj file. Once that was updated, the extra file stopped being generated for me.