mono

Get FQDN in C# running on Mono

依然范特西╮ 提交于 2019-12-25 01:55:33
问题 I'm using Xamarin.mac. I need to get the fully qualified domain name of the local computer. On Windows this code works: public string GetFQDN() { string domainName = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName; string hostName = Dns.GetHostName(); string fqdn = ""; if (!hostName.Contains(domainName)) fqdn = hostName + "." + domainName; else fqdn = hostName; return fqdn; } On a mac this code causes this error: System.NotSupportedException: This platform

Porting a .exe setup and mono framework on mac

橙三吉。 提交于 2019-12-25 01:44:34
问题 I have a requirement to deploy a windows .net application on a Mac OS. As i am a novice to mac, i need a step by step procedure to bundle the Mono Framework and my application setup(built in NSIS). Uses should be be able to directly click and install the application on a Mac. If possible please provide a simple step by step procedure how to go about with the process. Thanks, 回答1: i'm not quite sure whether i understood what you want to accomplish, so the following is based on some wild

How to compile Mono in Debian Wheezy

梦想与她 提交于 2019-12-25 01:41:31
问题 Trying to fix Mono SIGSEGV as described in How to fix SIGSEGV which prevents MVC application running in Mono I tried to compile newer mono from source codes: wget http://download.mono-project.com/sources/mono/mono-5.18.0.225.tar.bz2 cd /usr/local/src tar jxf mono-5.18.0.225.tar.bz2 cd mono-5.18.0.225 ./autogen.sh --prefix=/opt/m518 autogen stops with error that CMake 2.8.10 is required: .... Making install in btls make[2]: Entering directory `/usr/local/src/mono-5.18.0.268/mono/btls' mkdir -p

Activity as dialog: Place in top left corner

不打扰是莪最后的温柔 提交于 2019-12-25 01:33:29
问题 I'm trying to place an Android activity that uses the Holo.Dialog theme in the top left corner of my application by using the following code in OnCreate(): var layoutParams = this.Window.Attributes; layoutParams.Gravity = GravityFlags.Top | GravityFlags.Left; (This is Mono for Android) It kind of works, however there is a tiny gap between the actual corner and the beginning of my dialog, which you can see in the following screen shot: https://www.dropbox.com/s/cyy9lglq5642nz1/device-2013-05

Mono for Android 4.2初探

孤街醉人 提交于 2019-12-25 01:32:27
  最近发布的Mono for Android 4.2允许用户利用Xamarin设计界面创建美观简洁的用户界面。现在,我们可以通过拖拽操作在Visual Studio的XAML设计界面中任意处理UI元素。   最近发布的Mono for Android 4.2允许用户利用Xamarin设计界面创建美观简洁的用户界面(简称UI)。现在,我们可以通过拖拽操作在Visual Studio的XAML设计界面中任意处理UI元素。此外,MonoDevelop 3.0版本也已经面世,这是一款开源集成开发环境(简称IDE),能够运行于Linux、Mac OS X以及Windows系统当中。   为了达到客观的分析效果,这次我们会对MonoDevelop与Visual Studio 2010分别在32位及64位Windows 7系统中进行测试。 安装   Xamarin采用了一套综合型多合一安装工具,以确保安装流程简便易行。评测计划的第一步从下载开始,我们先从Xamarin官方网站上下载一个小小的setup.exe文件,它会自动检测用户完成安装所需要的其它组件。如果大家已经在系统中安装过Mono Droid的早期版本,则必须先彻底加以卸载再重新运行安装程序。Android SDK的旧有版本倒是没必要卸载,不过安装程序会自动下载被安装另一个版本,因此出于节约硬盘空间的考虑,大家最好还是一并删掉吧。  

How can I get directory name of a path?

左心房为你撑大大i 提交于 2019-12-24 22:31:36
问题 I tried using Path.GetDirectoryName() but it doesn't work. What I'm trying to get is from /home/nubela/test/some_folder , I wanna get "some_folder" How can I do this? The method should work for both Windows/Linux (Mono) Thanks! 回答1: If you have the path as a string already you can use this method to extract the lowest level directory: String dir = yourPath.Substring( yourPath.LastIndexOf(Path.DirectorySeparatorChar) + 1); Since this code uses Path.DirectorySeparatorChar it is platform

Unhandled Exception: System.TypeLoadException when running on mono, compiled on .NET 4

▼魔方 西西 提交于 2019-12-24 21:22:04
问题 I have written a small app in C# which works no problem. Target Framework is .NET 4. When I run the app under linux - mono , the app starts no problem. However I seem to be having a problem with Threading under mono. Code below: try { Thread oThread = new Thread(new ParameterizedThreadStart(this.SendSms)); oThread.IsBackground = true; oThread.Start(_data); while (!oThread.IsAlive) { Console.WriteLine("Sleeping..."); Thread.Sleep(1); } } catch (TypeLoadException tlex) { Console.WriteLine(

using visual studio IDE using Mono for Android

女生的网名这么多〃 提交于 2019-12-24 20:21:06
问题 I've been checking around for working with VS IDE instaed of Mono's, I understood that I have to download vsprj2me, something like that, but couldn't find any activate download for that. Is it true that I have to download it? And if so, can anybody supply me a link for a download? Thank you. 回答1: Default MonoDroid installer performs necessary configurations automatically. You should simply provide a path to the Android SDK: http://docs.xamarin.com/android/getting_started/installation

Monodevelop: embedded resource line-ending CRLF converted to LF?

…衆ロ難τιáo~ 提交于 2019-12-24 19:03:17
问题 I have a resource which isn't exactly textual. It's a file with some texts in it and some ansi control code. In my program I'm processing it as a binary file. However, I found that when I load it with System.Resources.ResourceManager.GetObject() as a byte[], all CRLFs are converted to LFs. This is not exactly what I want. I wonder if it's happening at compile time or runtime. The same project works fine on Xamarin on Windows and OS X. No conversion is happening. It's only happening on Linux.

How to get fresh copy if OutputCache(Location = OutputCacheLocation.Downstream is used

时光怂恿深爱的人放手 提交于 2019-12-24 18:43:17
问题 Mono MVC2 application uses controller below to cache order page in browser. If F5 is pressed in browser, old page is still returned to browser. How to return fresh page if F5 is pressed ? It looks like page is cached in server but OutputCacheLocation.Downstream must cache page only in borwser. Is this bug? [Authorize] public class DetailController : ControllerBase { [OutputCache(Location = OutputCacheLocation.Downstream, Duration = 20 * 60,VaryByParam = "_entity")] public ActionResult Index