|
|
|
date: Wed, 24 Oct 2007 06:07:01 -0700,
group: microsoft.public.dotnet.framework.component_services
back
.net 2 Enterprise Services components instantiate incorrect type
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?
date: Wed, 24 Oct 2007 06:07:01 -0700
author: F Atos F
RE: .net 2 Enterprise Services components instantiate incorrect type
I am having this exact problem too. Hopefully MS can provide an answer.
"F Atos" wrote:
> 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?
>
date: Thu, 15 Nov 2007 07:40:03 -0800
author: Terry
|
|