views:

169

answers:

1

Hi,

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.

A: 

Have you got a conflicting type/property/method/control called SeriousGameFactory at some level? That would do it...

Marc Gravell
I have 2 projects in my solution,project 1 default namespace = SeriousGameFactory.Framework(this is where the ImageResource class is)project 2 default namespace = Sogyo.InHolland.SeriousGameFactory.GameCreator(this is where the forms are)Sogyo.InHolland.SeriousGameFactory.GameCreator
I renamed Sogyo.Inholland.SeriousGameFactory.GameCreatorto SeriousGameFactory.GameCreator and it seems fixed.I really appreciate your help!, thx a bunch!
That makes sense - it is finding the default namespace first. It sounds like you're going to have to rename one of the namespaces to get it to behave itself. You could use `extern alias`, but that is a royal pain to do...
Marc Gravell
Ah - we were typing at the same time ;-p Glad it is sorted.
Marc Gravell