Object Persistence and Versioning with System.Activator

  • Thread starter Thread starter Patrick Fogarty
  • Start date Start date
P

Patrick Fogarty

While I wait for ObjectSpaces I have created a library of routines that
allow the persistence of my objects to SQL. Saving and retrieving the
objects work just fine. In fact it's all working well. My problem comes as
I look forward.

Inevitably, my class libraries (those that will be persisted as opposed to
those doing the persistence work) will evolve. So over time I will have
diferent versions of the same class/object persisted to the same database.
Assume for a moment that I have persisted, with the object, the name of the
assembly its class definition is in and the assembly's version. Assume also
that I have all versions of the desired assembly in the global cache. How
do I use System.Activator to instantiate a class from an assembly for which
there may be many version available, but only one will do?


- Patrick
 
Hello Patrick,

Thanks for posting in the group.

I think you coud use:

System.Activator.CreateInstanceFrom(@"c:\windows\assembly\gac\system.web\1.0
.3300.0__b03f5f7f11d50a3a\system.web.dll", controlName);

Please post here if the problem is not resolved.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Patrick Fogarty" <[email protected]>
!Subject: Object Persistence and Versioning with System.Activator
!Date: Sun, 21 Sep 2003 10:01:54 -0400
!Lines: 18
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <#[email protected]>
!Newsgroups: microsoft.public.dotnet.framework
!NNTP-Posting-Host: ool-182e5a0b.dyn.optonline.net 24.46.90.11
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:54330
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!While I wait for ObjectSpaces I have created a library of routines that
!allow the persistence of my objects to SQL. Saving and retrieving the
!objects work just fine. In fact it's all working well. My problem comes
as
!I look forward.
!
!Inevitably, my class libraries (those that will be persisted as opposed to
!those doing the persistence work) will evolve. So over time I will have
!diferent versions of the same class/object persisted to the same database.
!Assume for a moment that I have persisted, with the object, the name of the
!assembly its class definition is in and the assembly's version. Assume
also
!that I have all versions of the desired assembly in the global cache. How
!do I use System.Activator to instantiate a class from an assembly for which
!there may be many version available, but only one will do?
!
!
!- Patrick
!
!
!
 
Back
Top