每次表单更改都必须更正表单设计器生成的代码名称空间
我有几种具有这种奇怪行为的表格。
例如,我有这个表单生成的代码。
namespace Sogyo.InHolland.SeriousGameFactory.GameCreator
{
partial class FormAvatarResourceSetEditor
{
this.bindingSourceAvatarResourceSets.DataSource = typeof(SeriousGameFactory.Framework.ImageResource);
}
}
在这种情况下,当我按构建时,编译器抱怨它无法识别“SeriousGameFactory.Framework.ImageResource”。 (Intellisense 似乎无法在 SeriousGameFactory 命名空间中找到 Framework 命名空间)
然后我手动将其更改为以下代码
using SeriousGameFactory.Framework;
namespace Sogyo.InHolland.SeriousGameFactory.GameCreator
{
partial class FormAvatarResourceSetEditor
{
this.bindingSourceAvatarResourceSets.DataSource = typeof(ImageResource);
}
}
现在项目已构建。 (奇怪的 !??) 但是,当我打开表单并使用它时,Visual Studio 会自动生成以下代码。
using SeriousGameFactory.Framework;
namespace Sogyo.InHolland.SeriousGameFactory.GameCreator
{
partial class FormAvatarResourceSetEditor
{
this.bindingSourceAvatarResourceSets.DataSource = typeof(SeriousGameFactory.Framework.ImageResource);
}
}
它再次无法编译。 (Intellisense 似乎无法在 SeriousGameFactory 命名空间中找到 Framework 命名空间)
是否有人对可能导致此问题的原因有任何想法。
I have several forms with this strange behaviour.
For instance I have this form generated code.
namespace Sogyo.InHolland.SeriousGameFactory.GameCreator
{
partial class FormAvatarResourceSetEditor
{
this.bindingSourceAvatarResourceSets.DataSource = typeof(SeriousGameFactory.Framework.ImageResource);
}
}
In this case when i press build the compiler complains that it does not recognize "SeriousGameFactory.Framework.ImageResource". (Intellisense does not seem to be able to find the Framework namespace within the SeriousGameFactory Namespace)
I then change this manually to the following code
using SeriousGameFactory.Framework;
namespace Sogyo.InHolland.SeriousGameFactory.GameCreator
{
partial class FormAvatarResourceSetEditor
{
this.bindingSourceAvatarResourceSets.DataSource = typeof(ImageResource);
}
}
Now the project builds. (strange !??)
However when i open the form and work with it, visual studio autogenerates the following code.
using SeriousGameFactory.Framework;
namespace Sogyo.InHolland.SeriousGameFactory.GameCreator
{
partial class FormAvatarResourceSetEditor
{
this.bindingSourceAvatarResourceSets.DataSource = typeof(SeriousGameFactory.Framework.ImageResource);
}
}
And again it does not compile. (Intellisense does not seem to be able to find the Framework namespace within the SeriousGameFactory Namespace)
Does anybody has any thoughts on what could cause this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否在某种程度上有一个名为
SeriousGameFactory
的冲突类型/属性/方法/控件? 这样就可以了...Have you got a conflicting type/property/method/control called
SeriousGameFactory
at some level? That would do it...