// 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));
}
}
Entry point getaddrinfo not found in WS2_32.DLL in Windows 2000
在我的例子中,错误报告和 Dr. Watson 已关闭,因此错误消息可能被 Windows 吞没(我在工业 PC 上进行了测试,错误报告会使重要程序挂起)。我试图打开它,但我仍然没有收到任何错误消息 - mono 和 mcs 只是停止而不做任何事情。尽管如此,我认为这就是问题所在,因为这是一个与版本相关的、显示停止的错误,在我的情况下,版本是相同的。
Mono 开发者 Zoltan Varga 在错误报告中添加了以下评论:
Unlike freeaddrinfo, getaddrinfo is actually required by parts of mono so its
usage cannot be avoided without disabling some functionality. MSDN suggests
including Wspiapi.h, which we cannot do since it is part of MS's Platform SDK,
and it is not in cygwin/mingw, which we use for compiling releases of mono. So
you probably need to compile your own version of mono on windows and work
around these problems.
Support for getaddrinfo on Windows 2000 and older versions - The getaddrinfo function was added to the Ws2_32.dll on Windows XP and later. To execute an application that uses this function on earlier versions of Windows, then you need to include the Ws2tcpip.h and Wspiapi.h files. When the Wspiapi.h include file is added, the getaddrinfo function is defined to the WspiapiGetAddrInfo inline function in the Wspiapi.h file. At runtime, the WspiapiGetAddrInfo function is implemented in such a way that if the Ws2_32.dll or the Wship6.dll (the file containing getaddrinfo in the IPv6 Technology Preview for Windows 2000) does not include getaddrinfo, then a version of getaddrinfo is implemented inline based on code in the Wspiapi.h header file. This inline code will be used on older Windows platforms that do not natively support the getaddrinfo function.