Home All Groups Group Topic Archive Search About

specify clr version

Author
17 May 2006 3:48 PM
Josh Bernard
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?

Author
17 May 2006 3:56 PM
Eric Cadwell
Are you using the requiredRuntime tag?
http://www.gotdotnet.com/team/changeinfo/

Are you sure 1.1 is available on those machines? If it's required and not
available it should throw an exception on startup.

-Eric
Author
17 May 2006 4:04 PM
Josh Bernard
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>


Show quote
"Eric Cadwell" wrote:

> Are you using the requiredRuntime tag?
> http://www.gotdotnet.com/team/changeinfo/
>
> Are you sure 1.1 is available on those machines? If it's required and not
> available it should throw an exception on startup.
>
> -Eric
>
>
>
Author
17 May 2006 4:19 PM
Josh Bernard
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?

Show quote
"Josh Bernard" wrote:

> 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?
Author
17 May 2006 5:48 PM
Naveen
Use exe.config for application that lauches the managed component. The
exe.config can be configured for non managed exe also.
Author
17 May 2006 6:01 PM
Josh Bernard
Im not sure what you mean. I am using vb6 to call the component, Im not aware
of any config files for vb6 apps.

Show quote
"Naveen" wrote:

> Use exe.config for application that lauches the managed component. The
> exe.config can be configured for non managed exe also.
>
>
Author
17 May 2006 6:07 PM
Naveen
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.
Author
17 May 2006 6:16 PM
Josh Bernard
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?

Show quote
"Naveen" wrote:

> 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.
>
>
Author
17 May 2006 6:22 PM
Naveen
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>
Author
17 May 2006 6:11 PM
Michael Nemtsev
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
Author
17 May 2006 6:49 PM
Josh Bernard
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?

Show quote
"Michael Nemtsev" wrote:

> 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
>
>
>
Author
17 May 2006 7:00 PM
Michael Nemtsev
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>
Show quote
JB> "Michael Nemtsev" wrote:
JB>
>> 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
>>
---
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

AddThis Social Bookmark Button