[Mono-list] replacement for mscoree.dll

Guenther Roith groith@tcrz.net
Tue, 31 Dec 2002 13:57:20 +0100


> Well, I just tried to build the file with gcc and it doesn't seem to
> like it, maybe you can find out what exactly is 'wrong'.
>
> Anyway, I have been looking at mscoree.dll & surrounding some more (also
> looking at the dotgnu discussions about this).
>
> It might be interesting to see if we can the following to work:
>
> You can have a <yourapp>.exe.config file containing information about
> the required Runtime.
> Example:
> ----
> <configuration>
>     <startup>
>         <requiredRuntime version="v1.0.0.1" safemode="true"/>
>     </startup>
> </configuration>
> ----
>
> Executing an application with this config file will result in the
> message "C:\WINNT\Microsoft.NET\Framework\v1.0.0.1\mscorwks.dll could
> not be loaded".
>
> Now, if you create that dir and put a 'fake' mscorwks.dll (rename the
> mscoree.dll build from my sources) in the directory, then everything
> works ok again (read: mono is used to execute the .NET application).
>
> What happens is that Microsofts mscoree.dll will first look at the
> .config file. The config file tells it to use the runtime 'v1.0.0.1'
> (which doesn't really exists officially, but it's just a way for our
> 'runtime' to be used). Next it will load mscorwks.dll and have it
> execute the .NET application.
>
> Now a possible scenario would be to have a mono + a mscorwks.dll
> installed in "C:\WINNT\Microsoft.NET\Framework\"<SOME_VERSION>\.
> Where SOME_VERSION is a version that is not being used by Microsoft
> (else we have a conflict with an installed .NET Framework).
>


I knew about this. Somewhere in the registry the directory for this specail
version can be set (instead of "C:\WINNT\Microsoft.NET\Framework\" ).
The problem here is, that this solution requires the Microsoft mscoree.dll
to be installed.


> Next step would be to have mcs generate executables that don't need a
> .config file to execute through this mechanism (the resulting exe should
> probably contain some kind of reference to a 'SOME_VERSION' runtime, so
> mscoree will select the correct runtime: mono).

That is IMO possible, however I like config-file better, because that way we
can also execute MS compiled apps with mono.

Maybe we endup, distributing a config file _and_ mscoree.dll.

Johannes