Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error BC30311: Value of type 'x' cannot be converted to 'x'

63 views
Skip to first unread message

David

unread,
Jan 5, 2004, 12:53:35 PM1/5/04
to
I am getting the following error during run-time
compilation or a rebuild all of my application:

error BC30311: Value of type 'mynamespace.x' cannot be
converted to 'mynamespace.x'

This occurs in only one component/project that accesses
the 'x' object whereas several other components/projects
also use the 'x' object in several other locations in
exactly the same way without any problems. If I Rebuild
ONLY this component it compiles without error, but on the
next Run compile the error returns. It shows up briefly in
the Build Error tasks and then disappears. Odd (I think).

Any suggestions?

Thanks,

David

One Handed Man [ OHM# ]

unread,
Jan 5, 2004, 12:59:22 PM1/5/04
to
Either use an alias for the namespace or using fully qualified identifiers
in your code.

Regards - OHM

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


David

unread,
Jan 5, 2004, 1:36:05 PM1/5/04
to
thank you. unfortunately I had already tried this approach
and it failed to make a difference:

I have tried:
Imports mynamespace.x
and then a direct reference to 'x'

as well as a fully qualified reference to 'x'

both failed.

Any other thoughts?

Thanks,

David

>.
>

One Handed Man [ OHM# ]

unread,
Jan 5, 2004, 2:12:34 PM1/5/04
to
If this is a clash, then dont use the imports statement. In each case use
the fully qualified id

If you are fully qualifying the identifier in each instance which it is
referred, then it cannot be a clash between namespaces, something else must
be going on. The fact that you were able to compile it once suggest that
there may be some declarative dependency ( a bug ).

One suggestion may be to create a new project and re-add all the resources
and see if this clears the problem. Most odd !

David

unread,
Jan 5, 2004, 2:29:52 PM1/5/04
to
Thanks for taking the time to respond. I'll give it a try.

David

>.
>

Herfried K. Wagner [MVP]

unread,
Jan 5, 2004, 4:02:08 PM1/5/04
to
* "David" <drk...@no-spam.hotmail.com> scripsit:

Are you using more than one project in the same solution? Maybe
changing the build order helps (right-click the solution and choose the
appropriate menu item). Are you sure there is no name conflict?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Peter Huang

unread,
Jan 5, 2004, 11:22:35 PM1/5/04
to
Hi David,

I agree with Herfried's suggestion.
Have you tried that?Did that work for you?
If no, you may try to create a new project and declare a new namespace to
see if the problem persists, and then add the code line from your original
namespace project step by step to see what cause the error.

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

David

unread,
Jan 6, 2004, 1:58:03 PM1/6/04
to
Thank you gentlemen for taking the time to respond.

I went back and changed all of my references from these
components from the Actual DLL (rerferenced from the Bin
of that specific project) to the DLL under the projects
tab instead and it all seems to be running okay now.

Thanks for your suggestions.

David

>.
>

Herfried K. Wagner [MVP]

unread,
Jan 6, 2004, 6:32:08 PM1/6/04
to
* "David" <drk...@no-spam.hotmail.com> scripsit:

> I went back and changed all of my references from these
> components from the Actual DLL (rerferenced from the Bin
> of that specific project) to the DLL under the projects
> tab instead and it all seems to be running okay now.

Thank you for sharing this experience with us.

raviraj_bh

unread,
Aug 13, 2004, 11:48:48 AM8/13/04
to

Hi,
I run into same problem. I even tried this approach to use PROJECT
REFERENCE instead of file reference. But it failed. I checked on
Microsoft sute http://tinyurl.com/5hwpp I used this hint, used file
refernce and it worked. However in some other scenario (i have about 25
projects:some C# and some VB.Net) it failed and i had to go back to
project references.
So i think best solution is - try first project reference, if it does
not work, try file reference. Either of them is guanranteed to work -
as per my experience.

Thanks
Ravi

David wrote:
> *Thank you gentlemen for taking the time to respond.

> > *

--
raviraj_bh
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message245902.html

0 new messages