specify clr version

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a managed library I am using with interop but must use the v1.1
framework. On machines with v2 installed it defaults to that and the
component fails. I created an app.config file in the managed project and
specified the correct version but it is still using v2. Is there something Im
missing here?
 
yes, Here is the data from my config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<requiredRuntime version="v1.1.4322"/>
<supportedRuntime version="v1.1.4322"/>
</startup>
</configuration>
 
Upon further reading, it appears that you cannot use app.config files with
class libraries. If thats the case then how can I sepcify what version of the
runtime is to be used when this library is consumed by a COM application?
 
Use exe.config for application that lauches the managed component. The
exe.config can be configured for non managed exe also.
 
Im not sure what you mean. I am using vb6 to call the component, Im not aware
of any config files for vb6 apps.
 
I think you should try doing it. It works. If you want more info how
this works you should probably read book on Hosting CLR which gives you
more insight.
 
Hello Josh,

For the COM Interoperability CLR starts the latest version of the framework.
To specify desired version you need to create the app.config for the unmanaged
app, (as Naveen said) it's may sound weird,
but when CRL is going to start mscoree.dll looks for the configuration file
based on the name of the executable that started the process (as obtained
by calling the Microsoft Win32 API GetModuleFileName and apply config to
this unmanaged application.

JB> I have a managed library I am using with interop but must use the
JB> v1.1 framework. On machines with v2 installed it defaults to that
JB> and the component fails. I created an app.config file in the managed
JB> project and specified the correct version but it is still using v2.
JB> Is there something Im missing here?
JB>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
do you have links to where I can find info about exe.config because I cannot
find anything about it. Does it get added to the vb6 app? what information
goes in it?
 
Just create an Foo.exe.config (Foo being the application name) and with
in that copy the same thing that you have posted before

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<requiredRuntime version="v1.1.4322"/>
<supportedRuntime version="v1.1.4322"/>
</startup>
</configuration>
 
thanks! that works nicely. Now the problem I have is that it doesn't work
when I debug the vb6 app. When debugging a vb6 app is the executable placed
in a temp directory somewhere?
 
Hello Josh,

I'm not the VB guy and not familiar with VB debugging :), try too search
by your filename

JB> thanks! that works nicely. Now the problem I have is that it doesn't
JB> work when I debug the vb6 app. When debugging a vb6 app is the
JB> executable placed in a temp directory somewhere?
JB>
JB> "Michael Nemtsev" wrote:
JB>---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Back
Top