更改程序集名称会出现错误
当我更改项目的程序集名称(即从“Gui”到“Gui2”)时,我在构建过程中遇到许多错误。大多数这些错误都包含“找不到 xxxx(您是否缺少 using 指令或程序集引用?)
我做错了什么?
When I change the assembly name of my project, i.e from "Gui" to "Gui2", I get many errors during build. Most of these errors contain "xxxx could not be found (Are you missing a using directive or an assembly reference?)
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要修复对该程序集的所有引用才能使用新名称。根据您进行更改的方式,您可能还需要修复命名空间引用。
You'll need to fix up all of the references to that assembly to use the new name. Depending on how you made the change, you may also need to fix up namespace references.
如果您在解决方案中的任何其他项目中引用此程序集,则会出现此错误,因为具有旧名称的程序集不再存在。
如果您还更改了命名空间,则还必须更改代码中的所有命名空间引用。
如果您还更改了命名空间,则还
如果您仍然无法弄清楚,您可以离线向我详细介绍 [email protected ]
If you are referencing this Assembly in any of the other projects in your solution, those will give you this error as the assembly with the old name doesn't exist anymore.
If you also changed the namespace, you will have to change all the namespace references in your code as well.
If you are still unable to figure it out you can detail it to me offline at [email protected]
也许您的解决方案中有另一个项目需要更新对该程序集的引用?也许当您更改程序集名称时,Visual Studio 也更改了程序集的命名空间,并且整个项目/解决方案中的“using”语句需要更新?
Maybe you have another project in the solution that needs to update a reference to that assembly? Maybe Visual Studio also changed the namespace of the assembly when you changed its name and "using" statements throughout the project/solution need to be updated?
您是否还更改了项目中类的命名空间?
如果这样做,则必须确保在引用更改的命名空间中的类的源文件中添加适当的
using
指令。Did you also change the namespace of the classes in the project?
If you did, you have to make sure that you add appropriate
using
directives in the source files that reference classes in the changed namespace.您是否重新引用了新的 DLL?
Have you re-referenced the new DLL?