![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 2.0 program creates instance of programs of different dotnet version Dear All, I think it is a common problem in upgrading program from one DotNet framework to another. You may not have sufficient time to upgrade all the programs at one time and thus will upgrade and deploy them phase by phase, right? In my case, we have developed a program (2.0) which acts a common access point of all these programs. It uses CreateInstance method to initalize program as follow: Dim asm As System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom(<Full path of DLL>) Dim ty As Type = asm.GetType(<Full Name of Class>) obj = Activator.CreateInstance(ty) However, I encountered the following error at CreateInstance() for 1.1 programs: System.Reflection.TargetInvocationException {"Exception has been thrown by the target of an invocation."} Data {System.Collections.ListDictionaryInternal} HelpLink Nothing InnerException {System.IO.FileNotFoundException} Message Exception has been thrown by the target of an invocation. Source mscorlib StackTrace at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at Menu.frm_MainMenu.label_Click(Object sender, Int32 menuID) in C: \ProgramSource\Program\2.0\CR11\Menu\frmMainMenu.vb:line 1066 TargetSite {System.Reflection.RuntimeMethodInfo} It seems that instance created is not able to load referenced v1.1 assembly in path of .dll. Does anyone have similar experience on such issue and have any suggestion to me? Please kindly advise. Thanks! Cherry |
My System Specs![]() |
| | #2 (permalink) |
| | Re: 2.0 program creates instance of programs of different dotnetversion Hi All, Here i need to clarify the error I've encountered: System.Reflection.TargetInvocationException ----------{"Exception has been thrown by the target of an invocation."} Data----------{System.Collections.ListDictionaryInternal} HelpLink----------Nothing InnerException----------{"Method not found: 'Infragistics.Win.UltraWinToolbars.UltraToolbarsManager VBbaseform.frmFilter.get_UToolbars()'."} Message Exception has been thrown by the target of an invocation. Source----------mscorlib StackTrace----------" at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at Menu.frm_MainMenu.label_Click(Object sender, Int32 menuID) in C: \ProgramSource\Program\2.0\CR11\Menu\frmMainMenu.vb:line 1066" TargetSite----------System.Reflection.RuntimeMethodInfo} It seems that instance created is not able to load referenced v1.1 assembly in path of .dll. (Please note that The create instance program is at different location with the dll to be created) Any idea? On 9$B7n(B9$BF|(B, $B2<8a(B2$B;~(B53$BJ,(B, cherry <cherryparadise...@xxxxxx> wrote: Quote: > Dear All, > > I think it is a common problem in upgrading program from one DotNet > framework to another. > You may not have sufficient time to upgrade all the programs at one > time and thus will upgrade and deploy them phase by phase, right? > > In my case, we have developed a program (2.0) which acts a common > access point of all these programs. > It uses CreateInstance method to initalize program as follow: > > Dim asm As System.Reflection.Assembly > asm = System.Reflection.Assembly.LoadFrom(<Full > path of DLL>) > > Dim ty As Type = asm.GetType(<Full Name of Class>) > obj = Activator.CreateInstance(ty) > > However, I encountered the following error at CreateInstance() for 1.1 > programs: > System.Reflection.TargetInvocationException {"Exception has been > thrown by the target of an invocation."} > Data {System.Collections.ListDictionaryInternal} > HelpLink Nothing > InnerException {System.IO.FileNotFoundException} > Message Exception has been thrown by the target of an invocation. > Source mscorlib > StackTrace at System.RuntimeTypeHandle.CreateInstance(RuntimeType > type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, > RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) > > at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, > Boolean fillCache) > > at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, > Boolean skipVisibilityChecks, Boolean fillCache) > > at System.Activator.CreateInstance(Type type, Boolean nonPublic) > > at System.Activator.CreateInstance(Type type) > > at Menu.frm_MainMenu.label_Click(Object sender, Int32 menuID) in C: > \ProgramSource\Program\2.0\CR11\Menu\frmMainMenu.vb:line 1066 > TargetSite {System.Reflection.RuntimeMethodInfo} > > It seems that instance created is not able to load referenced v1.1 > assembly in path of .dll. > > Does anyone have similar experience on such issue and have any > suggestion to me? > > Please kindly advise. > > Thanks! > > Cherry |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Which version of dotnet? | .NET General | |||
| Beginner - which is best dotnet.VB or dotnet.VC? | .NET General | |||
| Getting old version of program from shortcut | Vista General | |||
| Startup Programs have more than one instance | Vista General | |||
| DotNet program opens shadow datafile rather than the current one | Vista General | |||