1

I have an application which currently runs in the .NET 3.5 framework. However, in the event that SharePoint 2013 is installed, the application needs to load up a different set of dlls that will utilize .NET 4.0 and/or 4.5. From my understanding, creating a 'bootstrapper' would handle the event.

Going around and evaluating the SharePoint version will be easy enough, but how do I set up the logic for which set of dlls to load for the application? I am currently working off of the assumption that it will deal with dynamically loading the dlls, but I am unsure as to the best method to approach this.

What would be the best way to dynamically choose between .NET versions?

Some links I have already looked into include: Specifying the location of .Net configuration files and MSBuild, conditional NET runtime and Conditional Compilation and Framework Targets. But I was not able to glean a lot of useful information from them. Currently I am exploring along the line of this question: DllImport vs LoadLibrary, What is the best way?

Community
  • 1
  • 1
wjhguitarman
  • 1,063
  • 1
  • 9
  • 27

1 Answers1

0

You can try setting supportedRuntime in your App.config to choose the .Net version.

Something like:

<configuration>
   <startup>
      <supportedRuntime version="v4.0"/>
   </startup>
</configuration>
alex
  • 12,464
  • 3
  • 46
  • 67
  • Piggybacking off of your suggestion, I also found a similar link http://www.davidmoore.info/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime/ which I will be looking into to see if I get the expected behavior – wjhguitarman Apr 15 '13 at 18:56