Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

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

[sIGPIC]e[/sIGPIC]
Posted
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.
  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...