My application is a native, non-.NET application. However, at times it may need to invoke some .NET services through COM. Sometimes it needs to load a specific version of .NET to accomplish what it needs to do. (My app uses a COM interface to System.EnterpriseServices
in order to programmatically register assemblies and install them in the GAC).
Normally, I could use MyApp.exe.config
(as explained here) if this information was known ahead of time and didn't change between runs.
Unfortunately, the specific version of .NET to load will not be known until runtime (and in fact, may change between runs on the same system). Therefore using MyApp.exe.config
will not work.
Is there a way for a native application to supply this information to Windows programmatically before it loads .NET?
(Though my application is written in Delphi, this is more of a general Windows question and answers in any language would be welcome)