Connecting Tech Pros Worldwide Help | Site Map

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

  #1  
Old November 20th, 2005, 11:14 AM
David
Guest
 
Posts: n/a
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

  #2  
Old November 20th, 2005, 11:14 AM
One Handed Man [ OHM# ]
Guest
 
Posts: n/a

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


Either use an alias for the namespace or using fully qualified identifiers
in your code.

Regards - OHM

David wrote:[color=blue]
> 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[/color]

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


  #3  
Old November 20th, 2005, 11:14 AM
David
Guest
 
Posts: n/a

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


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
[color=blue]
>-----Original Message-----
>Either use an alias for the namespace or using fully[/color]
qualified identifiers[color=blue]
>in your code.
>
>Regards - OHM
>
>David wrote:[color=green]
>> 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[/color][/color]
the[color=blue][color=green]
>> next Run compile the error returns. It shows up briefly[/color][/color]
in[color=blue][color=green]
>> the Build Error tasks and then disappears. Odd (I[/color][/color]
think).[color=blue][color=green]
>>
>> Any suggestions?
>>
>> Thanks,
>>
>> David[/color]
>
>--
>Best Regards - OHM
>
>O_H_M{at}BTInternet{dot}com
>
>
>.
>[/color]
  #4  
Old November 20th, 2005, 11:14 AM
One Handed Man [ OHM# ]
Guest
 
Posts: n/a

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


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:[color=blue]
> 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
>[color=green]
>> -----Original Message-----
>> Either use an alias for the namespace or using fully qualified
>> identifiers in your code.
>>
>> Regards - OHM
>>
>> David wrote:[color=darkred]
>>> 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[/color]
>>
>> --
>> Best Regards - OHM
>>
>> O_H_M{at}BTInternet{dot}com
>>
>>
>> .[/color][/color]

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


  #5  
Old November 20th, 2005, 11:14 AM
David
Guest
 
Posts: n/a

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


Thanks for taking the time to respond. I'll give it a try.

David[color=blue]
>-----Original Message-----
>If this is a clash, then dont use the imports statement.[/color]
In each case use[color=blue]
>the fully qualified id
>
>If you are fully qualifying the identifier in each[/color]
instance which it is[color=blue]
>referred, then it cannot be a clash between namespaces,[/color]
something else must[color=blue]
>be going on. The fact that you were able to compile it[/color]
once suggest that[color=blue]
>there may be some declarative dependency ( a bug ).
>
>One suggestion may be to create a new project and re-add[/color]
all the resources[color=blue]
>and see if this clears the problem. Most odd !
>
>Regards - OHM
>
>
>
>David wrote:[color=green]
>> thank you. unfortunately I had already tried this[/color][/color]
approach[color=blue][color=green]
>> 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
>>[color=darkred]
>>> -----Original Message-----
>>> Either use an alias for the namespace or using fully[/color][/color][/color]
qualified[color=blue][color=green][color=darkred]
>>> 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[/color][/color][/color]
accesses[color=blue][color=green][color=darkred]
>>>> the 'x' object whereas several other[/color][/color][/color]
components/projects[color=blue][color=green][color=darkred]
>>>> also use the 'x' object in several other locations in
>>>> exactly the same way without any problems. If I[/color][/color][/color]
Rebuild[color=blue][color=green][color=darkred]
>>>> ONLY this component it compiles without error, but on[/color][/color][/color]
the[color=blue][color=green][color=darkred]
>>>> next Run compile the error returns. It shows up[/color][/color][/color]
briefly in[color=blue][color=green][color=darkred]
>>>> the Build Error tasks and then disappears. Odd (I[/color][/color][/color]
think).[color=blue][color=green][color=darkred]
>>>>
>>>> Any suggestions?
>>>>
>>>> Thanks,
>>>>
>>>> David
>>>
>>> --
>>> Best Regards - OHM
>>>
>>> O_H_M{at}BTInternet{dot}com
>>>
>>>
>>> .[/color][/color]
>
>--
>Best Regards - OHM
>
>O_H_M{at}BTInternet{dot}com
>
>
>.
>[/color]
  #6  
Old November 20th, 2005, 11:15 AM
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a

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


* "David" <drkozak@no-spam.hotmail.com> scripsit:[color=blue]
> 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).[/color]

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>
  #7  
Old November 20th, 2005, 11:26 AM
Peter Huang
Guest
 
Posts: n/a

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


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.

  #8  
Old November 20th, 2005, 11:29 AM
David
Guest
 
Posts: n/a

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


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
[color=blue]
>-----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[/color]
new namespace to[color=blue]
>see if the problem persists, and then add the code line[/color]
from your original[color=blue]
>namespace project step by step to see what cause the[/color]
error.[color=blue]
>
>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[/color]
confers no rights.[color=blue]
>
>.
>[/color]
  #9  
Old November 20th, 2005, 11:30 AM
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a

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


* "David" <drkozak@no-spam.hotmail.com> scripsit:[color=blue]
> 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.[/color]

Thank you for sharing this experience with us.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
  #10  
Old November 21st, 2005, 12:31 AM
raviraj_bh
Guest
 
Posts: n/a

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



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:[color=blue]
> *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
>[color=green]
> >-----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[/color]
> new namespace to[color=green]
> >see if the problem persists, and then add the code line[/color]
> from your original[color=green]
> >namespace project step by step to see what cause the[/color]
> error.[color=green]
> >
> >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[/color]
> confers no rights.[color=green]
> >
> >.
> >[/color][/color]


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

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Value of type 'System.Drawing.Color' cannot be converted to 'Intege Supra answers 0 November 22nd, 2005 01:38 PM
Value of type 'Integer' cannot be converted Jim in Arizona answers 2 November 21st, 2005 11:34 AM
Value of type ...... Supra answers 1 November 21st, 2005 01:09 AM
Value of type 'System.Drawing.Color' cannot be converted to 'Intege Supra answers 0 July 21st, 2005 05:31 PM