mono

Get all methods from C# code using NRefactory

帅比萌擦擦* 提交于 2019-12-24 04:40:56
问题 How do I retrieve all the methods in a C# program using the NRefactory API ? CSharpParser parser = new CSharpParser(); SyntaxTree tree = parser.Parse(code); This creates a SyntaxTree but how do I get ONLY the list of methods from this SyntaxTree? 回答1: There is an in depth article about using NRefactory available on CodeProject. To get information from the SyntaxTree you can either visit the nodes or use the type system. To visit the method declaration nodes you can do: var parser = new

Use Mono for android on with Mono

佐手、 提交于 2019-12-24 04:37:11
问题 It looks really easy to switch MonoDevelop's compiler to Mono tools instead of .NET – you just need to pick a different framework under settings of the IDE. However, after switching to Mono and getting the project compiling by Mono tools, Mono for android no longer seems to be an available framework (i.e. the reference to it in the Android project turns red). Obviously, the build fails with tons of errors like Android.XXX.YYY is not a class or namespace name, etc. Is there a way to install

Creating a .Net solution on the command line with mono

我只是一个虾纸丫 提交于 2019-12-24 03:50:18
问题 I run Linux and have Mono installed, I do not have MonoDevelop installed. I would like to create solution and csproj files from the command line. How do I do this? A similar question has been asked, it was asked some time ago, with an answer stating it can't be done. But I can't accept this is the case. It appears Microsoft has a such a tool, projectgen.exe, at least for projects. If this truly is not possible what other options do I have? Do I need to hand generate templates and then modify

New SIGABRT after upgrading to Mono 4 running NUnit tests

为君一笑 提交于 2019-12-24 03:26:43
问题 We upgraded from Mono 3.12.0 to 4.0.1 the other day and now our NUnit tests crash with a SIGABRT and some other information. So far Google has been of no help and I'm running out of things to try (minus a rollback to 3.12.0). I was just hoping someone could maybe take a look and help me find a new avenue to explore!enter code here I've tried the --shadowcopy switch, the --framework=v4.0/mono-4.0 switch, etc. Console Output: matt@matt-T420:~/bah3$ ~/Downloads/nunit3/bin/nunit-console.exe --

Cross-platform high resolution tick counter on Mono?

穿精又带淫゛_ 提交于 2019-12-24 03:07:27
问题 I'm looking for a high resolution tick counter on Mono, preferably about the same resolution as a QueryPerformanceCounter on Win32/.NET. Is this something that needs to be implemented as a native call (like QueryPerformanceCounter is on .NET/Win32) on each platform I need to support? (Linux, OSX). I need about <1ms resolution. 回答1: You should use System.Diagnostics.Stopwatch for this. 回答2: See my answer here: https://stackoverflow.com/a/37882723/5073786 using Mono.Unix.Native; namespace drone

Cross-platform high resolution tick counter on Mono?

社会主义新天地 提交于 2019-12-24 03:07:12
问题 I'm looking for a high resolution tick counter on Mono, preferably about the same resolution as a QueryPerformanceCounter on Win32/.NET. Is this something that needs to be implemented as a native call (like QueryPerformanceCounter is on .NET/Win32) on each platform I need to support? (Linux, OSX). I need about <1ms resolution. 回答1: You should use System.Diagnostics.Stopwatch for this. 回答2: See my answer here: https://stackoverflow.com/a/37882723/5073786 using Mono.Unix.Native; namespace drone

Why doesn't my GTK# compiled binary (created with MonoDevelop) work on Windows?

跟風遠走 提交于 2019-12-24 02:44:10
问题 I created a C# project using MonoDevelop (Xamarin) on my Mac. From what I've read, it seems that Windows should be able to run the .exe if it has .Net installed. However, no such luck. Any pointers on getting this .exe to run in Windows? Thanks 回答1: From monodevelop, with the project open, click Project, then settings. Under the build flag, click general. Change the target framework to .NET 4.0 Client Profile. Make sure mono is installed on windows. http://www.go-mono.com/mono-downloads

Patching nant 0.91 to use mono 4.0

荒凉一梦 提交于 2019-12-24 02:18:20
问题 The Nant doesn't support mono 4, but fortunately there's a patch for it. I download the patch - http://sourceforge.net/tracker/download.php?group_id=31650&atid=402870&file_id=404197&aid=3206199 I also download the source. I unzip the source and copy the patch inside the directory. I run patch < mono-4.0.diff , but I got this error. can't find file to patch at input line 8 Perhaps you should have used the -p or --strip option? The text leading up to this was: |Index: src/NAnt.Core/Functions

MonoTouch System.EntryPointNotFoundException for a DLL

断了今生、忘了曾经 提交于 2019-12-24 02:16:31
问题 I'm trying to make a DLL with some native code functions that are accessed by my MonoTouch app. I followed the general methodology used by monotouch-bindings, where you: make an xcode project and put some native code in it build a static library (.a file) with xcodebuild run btouch with --link-with to make a .dll file add a reference to the .dll file in my MonoTouch app .. but whenever I try to use these functions in my app, I get System.EntryPointNotFoundException. Here's code for each thing

mono/linux socket denied?

為{幸葍}努か 提交于 2019-12-24 02:11:55
问题 I am using alchemy websockets and figured out enough to get something working on windows. I built alchemy on linux (ubuntu) with mono and ran my server. It gets a socket error. The port is >1k (port 8005 to be exact) Unhandled Exception: System.Net.Sockets.SocketException: Access denied at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 at System.Net.Sockets.TcpListener.Start (Int32 backlog) [0x00000] in <filename unknown>:0 at System.Net