Mono on Windows 2000 SP4

The good old version of Win2k has the highest supported version of the .NET Framework 2.0. If you want to run modern C # applications (for example, that use LINQ), the solution to the Download Page says that the latest version (3.0.1-beta) "works in all versions of Windows XP, 2003, Vista and Windows 7", but notes to The release, displayed by the installer, claims that "this assembly works in Windows 2000 or later."

As a quick test, I tried to compile and run the following code in a Win2k window using different versions of Mono (2.0, 2.10.9, 3.0.1-beta):

// Test.cs using System; using System.Linq; public static class Test { public static void Main() { Console.WriteLine(Environment.Version); int[] numbers1 = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; var numbers2 = from number in numbers1 where number < 5 select number; Func<int, int> negate = number => -1 * number; foreach (var number in numbers2) Console.WriteLine(negate(number)); } } 

I opened the Mono command prompt, changed the working directory to the Test.cs directory Test.cs and tried to compile it using mcs Test.cs

  • The old version 2.0 worked, I just had to use gmcs instead of mcs . I can successfully run the executable on Mono 2.0. (When I tried to run it on .Net 2.0, I got an exception, as expected.)
  • In the case of version 2.10.9 and 3.0.1-beta, nothing happened: exe was not created, and an error message was not displayed. These versions work in Windows XP, I can compile the code and run the executable file.

Questions: Is Windows 2000 Mono Supported? What happened to Mono between versions 2.0 and 3.0, which could explain the above compilation problem? What can be done to make the latest version work on Win2k?

+7
source share
2 answers

You do not need anything new than .NET 2.0 to get most of the nice features of .NET 3.5. Output type, lambda methods, etc. Supported by the C # 3 compiler included with Visual Studio 2008-2012, even when targeting .NET 2.0.

But here's an important link (pun;)): http://code.google.com/p/linqbridge/ LinqBridge provides full support for Linq-to-Objects on .NET 2.0.

+2
source

I tried every minor version between 2.0 and 3.0. I found that versions <= 2.4 work, but versions> = 2.6 do not. I checked the Release Notes for v2.6 , but could not find anything that could explain this. Then I googled "mono 2.6 windows 2000" and found that there was a critical error in Windows 2000 :

Getaddrinfo entry point not found in WS2_32.DLL in Windows 2000

In my case, the error message and Dr. Watson is disabled, so the error message probably swallowed Windows (I did tests on an industrial PC, where the error message ran important programs). I tried turning it on, but I still don't have an error message - mono and mcs just stop doing nothing. Despite this, I think this is a problem, because it is a version-related error, show-stopper, and in my case the versions are the same.

Mono developer Zoltan Varga added the following comment to the bug report:

Unlike freeaddrinfo, getaddrinfo is really required in parts of mono, so its use cannot be eliminated without disabling some functions. MSDN also offers Wspiapi.h, which we cannot do, since it is part of the MS Platform SDK, and this is not in cygwin / mingw, which we use to compile mono releases. So you probably have to compile your own version of mono on windows and work around these issues.

The solution proposed by MSDN , which Zoltan spoke of, is as follows:

Support for getaddrinfo on Windows 2000 and earlier . The getaddrinfo function was added to Ws2_32.dll in Windows XP and later. To run an application that uses this feature in earlier versions of Windows, you need to include the Ws2tcpip.h and Wspiapi.h files. When the Wspiapi.h include file is added, the getaddrinfo function is defined by the WspiapiGetAddrInfo built-in function in the Wspiapi.h file. At run time, the WspiapiGetAddrInfo function is implemented in such a way that if Ws2_32.dll or Wship6.dll (the file containing getaddrinfo in the IPv6 technology preview for Windows 2000) does not include getaddrinfo, then the getaddrinfo version is implemented inline based on the code in the Wspiapi header file. h. This embedded code will be used on older Windows platforms that do not support the getaddrinfo function.

This error was filed in 2010, received priority level 5 and has not been resolved since. This basically means that until someone solves this error, Windows 2000 is not supported by Mono> = 2.6 .

(I plan to try to apply the modifications suggested by MSDN and rebuild Mono 3.0 using VS2005 , but this seems to be not an easy task. If successful, I will update the answer.)

+4
source

All Articles