简体   繁体   English

每个表单更改都必须更正Form Designer生成的代码名称空间

[英]Form Designer Generated Code namespaces have to be corrected every form change

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". 在这种情况下,当我按build时,编译器会抱怨它无法识别“ SeriousGameFactory.Framework.ImageResource”。 (Intellisense does not seem to be able to find the Framework namespace within the SeriousGameFactory Namespace) (Intellisense似乎无法在SeriousGameFactory命名空间中找到Framework名称空间)

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. (奇怪!?)但是,当我打开表单并使用它时,Visual Studio会自动生成以下代码。

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) (Intellisense似乎无法在SeriousGameFactory命名空间中找到Framework名称空间)

Does anybody has any thoughts on what could cause this. 是否有人对导致此问题的原因有任何想法。

Have you got a conflicting type/property/method/control called SeriousGameFactory at some level? 在某个级别上,您是否遇到了名称为SeriousGameFactory的冲突类型/属性/方法/控件? That would do it... 那会做到的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM