473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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

Nov 20 '05 #1
9 41889
Either use an alias for the namespace or using fully qualified identifiers
in your code.

Regards - OHM

David wrote:
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


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2
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
-----Original Message-----
Either use an alias for the namespace or using fully qualified identifiersin your code.

Regards - OHM

David wrote:
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


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
.

Nov 20 '05 #3
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 !

Regards - OHM

David wrote:
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
-----Original Message-----
Either use an alias for the namespace or using fully qualified
identifiers in your code.

Regards - OHM

David wrote:
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


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #4
Thanks for taking the time to respond. I'll give it a try.

David
-----Original Message-----
If this is a clash, then dont use the imports statement. In each case usethe fully qualified id

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

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

Regards - OHM

David wrote:
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
-----Original Message-----
Either use an alias for the namespace or using fully qualified identifiers in your code.

Regards - OHM

David wrote:
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

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
.

Nov 20 '05 #5
* "David" <dr*****@no-spam.hotmail.com> scripsit:
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).


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>
Nov 20 '05 #6
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.

Nov 20 '05 #7
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
-----Original Message-----
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 tosee if the problem persists, and then add the code line from your originalnamespace 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.
.

Nov 20 '05 #8
* "David" <dr*****@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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9

Hi,
I run into same problem. I even tried this approach to use PROJEC
REFERENCE instead of file reference. But it failed. I checked o
Microsoft sute http://tinyurl.com/5hwpp I used this hint, used fil
refernce and it worked. However in some other scenario (i have about 2
projects:some C# and some VB.Net) it failed and i had to go back t
project references.
So i think best solution is - try first project reference, if it doe
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.

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
-----Original Message-----
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.

.

-
raviraj_b
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message245902.htm

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dica | last post by:
i'm getting an error when trying set my dataAdapter's selectCommand. the sqlStatement is a storedProc which takes parameters, so it's constructed as: sqlSelectCommand1.CommandText = ""; ...
4
by: Barry | last post by:
object type cannot be converted to target type - i am getting this error message occuring numerous times in my task list, my project compiles and runs ok but it is a nuisance, I think Ihva eheard of...
4
by: eelis.net | last post by:
Hi I tried to convert the following C# code to vb.net. code in C# ________________________________________________________________ using System; using System.Reflection; using...
3
by: news.microsoft.com | last post by:
I got this error "Object type cannot be converted to target type" in my VB Winforms application. When I click on it, it goes no where, how do I troubleshoot this? Thank you.
4
by: Mathieu Cartoixa | last post by:
Hi, I have been annoyed in one of my recent projects with a problem related to the explicit implementation of an interface on a value type. I will take an example to show the problem. Say we...
2
by: andy6 via DotNetMonster.com | last post by:
I took a c++ 6.0 project and converted it to c++ .net 2005 project. I want to make a web service out of it. One of the new files I created was a cpp where I have the webmethod pointing to a...
0
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
I have a web method and there are the following sections in web.config: <system.web> <webServices> <soapExtensionTypes> <add type="SampleClass.SampleExtension, SampleClass" priority="1"...
0
by: jianxin9 | last post by:
Hi everyone, I don't have a lot of experience with ASP and I was hoping someone could help me. I want to use our ASP form along with some javascript code to create a form where our patrons can...
1
by: vinayaktripathi | last post by:
Hi all, I need to send following data to a network device. byte MyArray=new byte { 0x00, 0x00, 0x00, 0xAF, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1CD }; But getting error : "Constant...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.