如何修复“命名空间 x 已包含 x 的定义"?错误?转换到 VS2010 后发生 [英] How to fix "namespace x already contains a definition for x" error? Happened after converting to VS2010

查看:27
本文介绍了如何修复“命名空间 x 已包含 x 的定义"?错误?转换到 VS2010 后发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具体错误发生在Resources.Designer.cs:

错误 2 命名空间ModulusFE"已包含StockChartX"的定义 Resources.Designer.cs 11 21 ModulusFE.StockChartX

Error 2 The namespace 'ModulusFE' already contains a definition for 'StockChartX' Resources.Designer.cs 11 21 ModulusFE.StockChartX

我在谷歌上搜索了这个,但仍然很困惑.有人知道我可以尝试什么吗?

I've googled this and am still quite confused. Does anyone know anything I might try?

我尝试过重建和清理,以及重命名 Resources.Designer.cs 文件,希望它能重建,但没有运气.

I have tried rebuilding and cleaning, as well as renaming the Resources.Designer.cs file in hopes that it would rebuild, but no luck.

代码顶部是这样写的:

// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.225
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>

任何想法将不胜感激.

推荐答案

我也遇到了这个问题,这是因为我创建了一个新的命名空间,但父命名空间包含一个同名的类.

I've had this problem, too, and it was because I created a new namespace, but the parent namespace contained a class with the same name.

这篇关于如何修复“命名空间 x 已包含 x 的定义"?错误?转换到 VS2010 后发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆