Leaders snarfblam Posted February 27, 2005 Leaders Posted February 27, 2005 If I target my application to either version of the .NET framework (so that version 1.0 users can still use my app) and include a call to a function existant only in version 1.1 (Application.EnableVisualStyles() to be specific), but only if the version of the framework running is 1.1, will I still encounter an error because of the reference to a nonexistant function? Here is my code: If Environment.Version.Major = 1 AndAlso Environment.Version.Minor = 1 Then Application.EnableVisualStyles() Application.DoEvents() End If Application.Run(New ZTechForm) 'Begins the program with an instance of our main form Quote [sIGPIC]e[/sIGPIC]
HJB417 Posted February 27, 2005 Posted February 27, 2005 If I were to guess, I guess it would compile, but if you attempt to invoke the method @ runtime using the 1.0 assemblies, it will throw a MissingMethodException. Quote
Leaders snarfblam Posted February 27, 2005 Author Leaders Posted February 27, 2005 I know it would compile. What I don't know is when an exception will be thrown: when my assembly is loaded, when the method containing the missing method is invoked, or only if I were to attempt to invoke the missing method. Quote [sIGPIC]e[/sIGPIC]
HJB417 Posted February 27, 2005 Posted February 27, 2005 the latter. I'm still guessing though ;) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.