mono

mono c# get application path

狂风中的少年 提交于 2019-12-31 10:57:12
问题 I am looking to get the directory of my application it seems to be different from regular c#? As in Path.GetDirectoryName(Application.ExecutablePath) is not working. 回答1: One correct and cross-platform solution would be Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) Note that both Environment.CurrentDirectory and Assembly.GetExecutingAssembly().Location (more exactly, the directory thereof) are semantically wrong even though they are often - but not always - the same directory:

Does Linux MONO support ASP.NET Core 2.2 MVC?

孤人 提交于 2019-12-31 07:47:05
问题 I'm not finding any clear answer on this. On the Compatibility page, they say: Everything in .NET 4.7 except WPF, WWF, and with limited WCF and limited ASP.NET async stack What about .NET Core 2.2? Is it possible to run it on MONO or not? I'm glad .NET Core framework is becoming more mature; but unfortunately it doesn't support legacy WebForms, and MONO's support for Core is unclear, so they don't mix well. 回答1: Mono 5.4 implements netstandard 2.0. Since ASP.NET Core 2.x runs on netstandard 2

load the entire ListView in background and get an UIControl inside each ListItem

℡╲_俬逩灬. 提交于 2019-12-31 05:14:13
问题 I need to load a ListView entirely and get an UIControl inside each ListItem even if the item view is not displayed on the screen. I tried the ChildViewAdded event, but it is raised only when the ListItem is displayed on the screen. So, I need a way to prepare my UI ListView programmatically before displaying it. Thanks in advance for your help. 回答1: Quick answer - if you need a real View for each item in your list then you don't want to use a virtualized control like a ListView. Instead you

swig + mono : C# example errors of not finding the library

余生颓废 提交于 2019-12-31 03:15:12
问题 I use swig 2.0.1 + mono 2.6/2.8 on Mac OS X 10.6.4. The overall build is OK, and the build of the C# examples is also OK. The problem is that when I run the example (mono runme.exe), I always get the following errors. Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for examplePINVOKE ---> System.TypeInitializationException: An exception was thrown by the type initializer for SWIGExceptionHelper ---> System.DllNotFoundException: example

Mono can't open sqlite database

馋奶兔 提交于 2019-12-31 02:59:11
问题 I'm attempting to do a very basic connection to a sqlite v3 database and I'm using monodevelop 3.0 and Mono 2.10 and am unable to get connected to the database. I can make the app create the database, but then it immediately fails attempting to connect to it. Any suggestions? I had started with a different database, but then decided to have my app attempt to create a database empty and then connect to it. This still seems to fail. SqliteConnection.CreateFile("db\\DataWorksProg.s3db");

Calling IronPython object from C# with mono

99封情书 提交于 2019-12-31 01:44:08
问题 I have the following IronPython code. class Hello: def __init__(self): pass def add(self, x, y): return (x+y) I need to call this from C#, and I came up with the following code. using System; using IronPython.Hosting; using IronPython.Runtime; using IronPython; using Microsoft.Scripting.Hosting; using Microsoft.Scripting; class Hello { public static void Main() { ScriptEngine engine = Python.CreateEngine(); ScriptSource script = engine.CreateScriptFromSourceFile("myPythonScript.py");

Missing h-files and Assistant Editor not working because of it (monoTouch/MonoDevelop)

ⅰ亾dé卋堺 提交于 2019-12-30 20:38:07
问题 I am missing the .h-files when I just started my HelloWorld in MonoTouch/MonoDevelop. I have the same question as this guy, but the answer provided did not help me. I just installed everything needed for MonoTouch on a MacBook running Lion. I followed the steps/instructions to install (see here) and then created a new solution. But since there are no .h-files, this means that whem I use the interface Builder in Xcode, I only get the "No Assistant Result" when I open the "Assistant Builder". I

Explanation of MProtect Errno 12 (ENOMEM)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-30 11:29:50
问题 I'm writing an iPhone application using Monotouch and recently the app has started crashing stating Mprotect failed at 0x863a000 (length 8192) with errno 12 followed by a rather lengthly stack trace and Springboard informing that "the application exited abormally with signal 6". I've read this question which states that the app has exhaused all the memory available on the iPhone. We have applied some general Dispose patterns to the app and generally disposed of any heavy objects as soon as we

Can't get monocov to compile (Mac OS x 10.7.4)

若如初见. 提交于 2019-12-30 10:03:14
问题 I am desperately searching for a coverage utility within mono. I have written some tests but there are most likely some parts of the code that are not excersized by my tests. I have been searching for a few weeks now for a coverage program that I can use with my dll's that are generated from my ASP.NET MVC project. I came across the monocov module and I have downloaded the source over here! as this page! told me to. I copied Mono.Cecil.dll into the source directory (for monocov) and installed

WinForms vs GtkSharp with Mono

江枫思渺然 提交于 2019-12-30 07:52:27
问题 When developing with Mono for an app to be run on Windows and Mac OSX (and maybe Linux) which would you suggest, WinForms or GtkSharp for the GUI and why ? Specific examples and success/horror stories would be much appreciated. 回答1: Cross platform development is a nice idea, but to be completely honest I have never seen an application that looks really good outside of its native environment. That is why I think, that if you really want to offer good user experience you should use native