[Mono-dev] How to find out what framework runtimes installed

Alexander Köplinger alkpli at microsoft.com
Wed May 24 12:24:43 UTC 2017


In general, you shouldn't need to care about the .NET Framework profile your app is compiled against when running it on (newer) Mono.

Today*, we only ship a single set of assemblies which implement the BCL (mscorlib, System.*) so your app always runs on
those no matter what profile it was compiled against. .NET is really good at keeping backwards compatibility in the API
so this works out fine. You get the same experience e.g. on Windows 10 which doesn't ship with .NET 2.0 by default, yet
an old app still works fine because it just runs on the newer framework.

I'd just keep the config file you posted which will make the warning go away on newer Mono's (it won't change anything about the
actual execution since there's only a single set of BCL assemblies there).

By the way, I'd strongly encourage you to not deal with Mono 3.x anymore and upgrade to the latest if possible, it'll save you a lot of trouble.

Hope this helps,
Alex

* a long time ago like in Mono 3.2.8 we actually compiled the BCL for each .NET Framework profile (2.0, 3.5, 4.0) and simply used ifdefs
to exclude APIs which were available in newer profiles, but that got unwieldily and made no real sense anymore since the underlying
implementation is the same anyway so we stopped doing that: http://www.mono-project.com/docs/about-mono/releases/4.0.0/#dropped-support-for-old-frameworks

On 24 May 2017, at 12:49, MarLOne <InfoSeeker002 at gmail.com<mailto:InfoSeeker002 at gmail.com>> wrote:

Hello,

If this sounds like a Deja Vu please excuse me as my search does not review
an answer to my question.

I am running/developing mono application in Linux Mint 17.3 (64-bit)

I know how to find out which version of mono I am using. I simply use mono
--version. I have two VM's of identical Linux Mint but one is running mono
version 5.0 while another running mono 3.2.8.

I have a hello world test console application built in MonoDevelop compiled
to Mono/.Net 2.0. I have used monodis on the executable to make sure it is
built to framework 2.0.

In the VM running 5.0, it does not seem to have framework 2.0 supported
install. The only framework is v4.0 and hence when I run that test program
it generate this message:
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319

Realizing that VM does not other framework versions installed, the loader
forces the program to run with framework 4 and then writing that warning
message to stdout. To silent this one simply include the supportedRuntime
element in the config file with version "v4.0.30319".

The question is:
How can I find out what versions of framework are installed and supported in
the machine?

In Windows VS has a tool called *clrver.exe*  which lists out all the
framework installed and available in the machine. Is there a similar tool in
Linux mono? If not how can I find out the hard way?

When I run the test program in the vm with mono 3.2.8 (which to me appears
to have lots of stuff in /usr/lib/mono including v2.0 supports), I can
dispense the config file and it is then using the v2 framework, the version
it is built with.

But if I include:
<startup>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="4.0.30319"/>
</startup>

in my config file, I can force that test program to run in v2.0. and if I
rotate the order, I can force the app to run in v4.0. Hence obviously the VM
with 3.2.8 contains supports for both v2 and v4 framework.

Is there a tool to list out the framework version that a machine supports?

Thanks.

MarL




--
View this message in context: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmono.1490590.n4.nabble.com%2FHow-to-find-out-what-framework-runtimes-installed-tp4670792.html&data=02%7C01%7Calkpli%40microsoft.com%7C5c5181d9edfe4886a14508d4a2949688%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636312206468353227&sdata=rMfngicXFsQoHTi1Dxwev8qOikuXftujxq8YOYqCf%2B8%3D&reserved=0
Sent from the Mono - Dev mailing list archive at Nabble.com<http://Nabble.com>.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.dot.net<mailto:Mono-devel-list at lists.dot.net>
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.dot.net%2Fmailman%2Flistinfo%2Fmono-devel-list&data=02%7C01%7Calkpli%40microsoft.com%7C5c5181d9edfe4886a14508d4a2949688%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636312206468353227&sdata=FkOYhrx9sOLUocvqE70t3Gd1oWgGBeSjiz%2FUoup6WZ4%3D&reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-devel-list/attachments/20170524/33296f56/attachment.html>


More information about the Mono-devel-list mailing list