vb.net 更改表单图标后,两个输出文件名解析为相同的输出?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21176060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 16:28:00  来源:igfitidea点击:

Two output file names resolved to the same output after changing form icon?

vb.netvisual-studio-2010resourcesresx

提问by user1676874

So I know the usual fix for this error is to delete the extra .resx file that was created when you renamed a form or something else on your application.. But I haven't created/renamed any forms, and I don't see any obvious double .resx files.. This all happened after choosing an.ico file for the icon, that's it.

所以我知道这个错误的通常解决方法是删除在您重命名表单或应用程序中的其他内容时创建的额外 .resx 文件..但我没有创建/重命名任何表单,我没有看到任何明显的双 .resx 文件。这一切都是在为图标选择 .ico 文件后发生的,就是这样。

EDIT:

编辑:

Well I had 2 .resx files that maybe have been about the same form fDesigner.resx and fMain.resx, the last one which was created an hour ago, I deleted it, but I'm STILL getting the same error, isn't there a file that references the .resx files?

好吧,我有 2 个 .resx 文件,它们可能与 fDesigner.resx 和 fMain.resx 的形式大致相同,最后一个是一个小时前创建的,我删除了它,但我仍然遇到相同的错误,不是有引用 .resx 文件的文件吗?

回答by user1676874

Oh well I found it, might as well answer it myself as well.. There should be a .vbproj file on your application directory, for VB.NET, I'm sure other languages have it different. But you have to edit this, whether you deleted your extra .resx or not:

哦,好吧,我找到了,不妨自己回答一下。.. 在您的应用程序目录中应该有一个 .vbproj 文件,对于 VB.NET,我确定其他语言有不同的。但是您必须编辑它,无论您是否删除了额外的 .resx:

<EmbeddedResource Include="yourMmainForm.resx">
  <DependentUpon>yourMainForm.vb</DependentUpon>
</EmbeddedResource>

In my case Designer.resx was already dependent upon my Main form so even after I deleted the file the duplicate was still there, ok now it's fixed.

在我的情况下,Designer.resx 已经依赖于我的主表单,所以即使在我删除文件后,副本仍然存在,现在已经修复了。