mono

GetAllNetworkInterfaces() throws exception

假装没事ソ 提交于 2020-01-03 17:12:10
问题 In Mono for Android I'm trying to obtain all the IP addresses for my device within the local network. I don't mind loopbacks but I'm not interested in calling DNS. The best way seems to be calling... using System.Net.NetworkInformation; NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); ...except it throws... System.EntryPointNotFoundException: getifaddrs Any suggestions? 回答1: Unfortunately this is a known bug in Mono for Android. The bug report is available here. 回答2:

What's the difference between monodis and ikdasm?

杀马特。学长 韩版系。学妹 提交于 2020-01-03 17:07:45
问题 I am using mono 3.8.0, after installation, i find there are two deassemblier programe in mono "bin" directory, "monodis" and "ikdasm" During test, i find the generated il file is different, the generated file by "ikdasm" is same as "ildasm.exe" in MS .Net, but "monodis" have a little different case such as "ctor" -> 'ctor' with single quote, two array dimension 回答1: monodis is an old version, written in C that also provides a few small features useful in understanding the metadata format (see

What is the Json.NET Mono assembly reference?

孤街醉人 提交于 2020-01-03 16:02:58
问题 I am trying to compile this Json.NET code: using Newtonsoft.Json; ... MyDesc d = JsonConvert.DeserializeObject<MyDesc>(jsonInput); ... with this command via mono (on ubuntu): $ mcs Main.cs -lib:/home/username/JsonNET/Net40/Newtonsoft.Json.dll But i am getting "no assembly reference"-error: error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference What is the correct Json.NET Mono assebmly reference? (-lib option looks right for this, but

What is the Json.NET Mono assembly reference?

本小妞迷上赌 提交于 2020-01-03 16:00:13
问题 I am trying to compile this Json.NET code: using Newtonsoft.Json; ... MyDesc d = JsonConvert.DeserializeObject<MyDesc>(jsonInput); ... with this command via mono (on ubuntu): $ mcs Main.cs -lib:/home/username/JsonNET/Net40/Newtonsoft.Json.dll But i am getting "no assembly reference"-error: error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference What is the correct Json.NET Mono assebmly reference? (-lib option looks right for this, but

Hello OS with C# & mono?

别等时光非礼了梦想. 提交于 2020-01-03 15:58:32
问题 Is there a way to identify in which OS we are running mono, with C# code? Some sort of Hello World, but instead of using a fixed string as an output use the current OS? 回答1: Try System.Environment.OSVersion You can also detect if your code is run under Mono or MS.NET: if (Type.GetType("Mono.Runtime") != null) { // we're on Mono IsMono = true; } else IsMono = false; 回答2: This link: http://mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F Give this code: using System;

Compatibility of .NET csc and Mono mcs

血红的双手。 提交于 2020-01-03 12:30:28
问题 I know .NET and Mono are binary compatible but given a set of source code, will csc and mcs produce the exact same 100% identical binary CLI executable? Would one be able to tell whether an executable was compiled with csc or mcs? 回答1: A lot of things are not fully defined in the spec, or are implementation-specific extensions. Examples of not-fully-specified: the synchronisation semantics of field-like events; this is explicitly open to implementations in the ecma spec; it is stricty defined

调试Mono源码分析Hello World的执行

南笙酒味 提交于 2020-01-03 10:20:23
本文目的很简单,简单分析一下下面语句是如何被Mono Runtime执行的: public class Hello1 { public static void Main() { System.Console.WriteLine("Hello, World!"); } } 由于自己也是刚接触Mono源码,以前一直停留于简单的应用之上,所以本文的分析不全面,只是为了能大致的了解Mono的执行流程,对基本的函数和流程有所了解,所以本文的风格为流水帐。 一、先简单的看下Mono源码的目录中的几个重要文件夹: 我这里使用的是不知道什么时候下载的某个历史版本2.6.7,目前我觉得重要的就3个文件夹,mcs为base framework这里除了常见的System namespace下的各种重要程序集之外还有以Mono作为namespace的一些程序集,听 雨痕 说玩Mono不能错过这些程序集,有空看下;libgc文件夹里貌似是提供GC的支持库;最重要一个文件夹就是mono了,下面着重看下这个目录,这里实现的是Mono Runtime,本文调试的代码也主要是这里的。 1.arch:此目录放了各种不同处理器的差异代码,看下x86里面就两个文件x86-codegen.h和tramp.c,这个tramp.c通过调用x86-codegen.h里的各种奇怪的宏提供了两个方法mono_arch_create

Mono doesn't write settings defaults

旧城冷巷雨未停 提交于 2020-01-03 10:19:22
问题 Here is my problem. If I use only one Windows Forms project and call only - Settings.Default.Save() when running it, Mono creates a user.config file with the default value for each setting. It is fine, so far so good. But now I add a class library project, which is referenced from the Windows Forms project and I move the settings from the Windows Forms project to the Class Library one. Now I do the same - Settings.Default.Save() and to my great surprise, Mono creates a user.config file with

Is the Reactive Framework (RX) available for use in Mono yet?

北慕城南 提交于 2020-01-03 09:04:14
问题 Been searching but the only thing I found was http://evain.net/blog/articles/2009/07/30/rebasing-system-reactive-to-the-net-clr which I got to work, but it feels like there should be a simpler way, specially since rx was first release back in mid 09. 回答1: You can now download it for .NET 3.5SP1 and .NET 4, so I wouldn't be at al surprised if it just worked against recent releases of Mono - no Silverlight doohickies required at all. Having said that, I haven't tried it at all against Mono :)

How to read from output in real time and stop at certain time if needed

◇◆丶佛笑我妖孽 提交于 2020-01-03 04:19:23
问题 so , i have this working code to display ping and statistics from System.Diagnostics.Process Process P = new Process(); P.StartInfo.FileName = "ping"; P.StartInfo.Arguments = "-c 3 8.8.8.8"; // Take 3 samples to 8.8.8.8 P.StartInfo.UseShellExecute = false; P.StartInfo.RedirectStandardOutput = true; string readData = ""; if (P.Start()) readData = P.StandardOutput.ReadToEnd(); // This will also wait for the process to at least close its stdout Console.Write(readData.ToString()); // Doing this,