Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us