HighTechTalks DotNet Forums  

.net 2 Enterprise Services components instantiate incorrect type

Dotnet Framework (Component Services) microsoft.public.dotnet.framework.component_services


Discuss .net 2 Enterprise Services components instantiate incorrect type in the Dotnet Framework (Component Services) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
F Atos
 
Posts: n/a

Default .net 2 Enterprise Services components instantiate incorrect type - 10-24-2007 , 09:07 AM






We have a solution that was built using .net 1.1 and Visual Studio 2003. I am
trying to upgrade it to .net 2.0 and am also using Visual Studio 2005.

Under .net 1.1, the components successfully installed into Enterprise
Services using a ‘Lazy Install’ – when the components are run for the first
time they were automatically installed. However under .net 2, only some
components appear. I observe the following error:
System.InvalidCastException: CoCreateInstance returned an unexpected type:
expected <Class_A>, received <Class_B>.

This error is occurring within Class_B, an Enterprise Service component,
when instantiating Class_A, another Enterprise Service component within the
same package.
public Class_B
...
dim a as Class_A = new Class_A

During debugging, instead of an object of Class_A being instantiated, the
class being created is the calling class, which then can not be assigned to
the variable of type Class_A.

In VS2005 I recreated the solution, projects and copied source code from
..net 1.1 solution, and initially the lazy install seemed to be working,
however it then broke again.

This problem can be solved by using regsvcs to manually install the
components, however is there a way to get them to install automatically?


Reply With Quote
  #2  
Old   
Terry
 
Posts: n/a

Default RE: .net 2 Enterprise Services components instantiate incorrect type - 11-15-2007 , 10:40 AM






I am having this exact problem too. Hopefully MS can provide an answer.

"F Atos" wrote:

Quote:
We have a solution that was built using .net 1.1 and Visual Studio 2003. I am
trying to upgrade it to .net 2.0 and am also using Visual Studio 2005.

Under .net 1.1, the components successfully installed into Enterprise
Services using a ‘Lazy Install’ – when the components are run for the first
time they were automatically installed. However under .net 2, only some
components appear. I observe the following error:
System.InvalidCastException: CoCreateInstance returned an unexpected type:
expected <Class_A>, received <Class_B>.

This error is occurring within Class_B, an Enterprise Service component,
when instantiating Class_A, another Enterprise Service component within the
same package.
public Class_B
...
dim a as Class_A = new Class_A

During debugging, instead of an object of Class_A being instantiated, the
class being created is the calling class, which then can not be assigned to
the variable of type Class_A.

In VS2005 I recreated the solution, projects and copied source code from
.net 1.1 solution, and initially the lazy install seemed to be working,
however it then broke again.

This problem can be solved by using regsvcs to manually install the
components, however is there a way to get them to install automatically?


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.