Tag: mono

Mac OS X下的Mono 3.4.0 mkbundle失败

我试图在MAC OS X 10.9(Mavericks)下制作静态二进制文件,这不需要单声道运行时。 这几乎是干净的机器,带有最新的更新和最新的XCode。 如果我没有设置构建体系结构,我有以下内容: mkbundle client-patcher.exe -o client-patcher OS is: Darwin Sources: 1 Auto-dependencies: False embedding: /Users/radubalan/tmp/client-patcher.exe Compiling: as -o temp.o temp.s cc -g -o client-patcher -Wall temp.c `pkg-config –cflags –libs mono-2` temp.o ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/libmono-2.0.dylib, file was built for i386 which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/libmono-2.0.dylib Undefined […]

Mono无法打开sqlite数据库

我正在尝试与sqlite v3数据库进行非常基本的连接,而我正在使用monodevelop 3.0和Mono 2.10,并且无法连接到数据库。 我可以让应用程序创建数据库,但它会立即尝试连接到它。 有什么建议? 我从一个不同的数据库开始,但后来决定让我的应用程序尝试创建一个空的数据库,然后连接到它。 这仍然似乎失败了。 SqliteConnection.CreateFile(“db\\DataWorksProg.s3db”); SqliteConnection conn = new SqliteConnection(“Data Source=file:db\\DataWorksProg.s3db”); conn.Open(); 这小段代码失败,并显示无法打开数据库文件的错误。 Mono.Data.Sqlite.SqliteException: Unable to open the database file 权限看起来不错,我在项目中有Sqlite3.dll,它似乎工作正常。 我错过了哪些明显的东西? 我在Visual Studio方面相当不错,但在Mono / Monodevelop环境中仍然相当新鲜。

为什么DllImport不能与“__Internal”一起使用?

我有C ++共享库,它为Linux和Windows提供了导出方法int MyFunc() 。 从C#开始,我会使用以下签名调用MyFunc 。 [DllImport(@”__Internal”, CharSet = CharSet.Ansi, EntryPoint = “MyFunc”)] static extern unsafe int MyFunc(); // Later I’m using : MyFunc(); 这段代码在Windows上工作正常但在linux内部这会抛出exception的EntryPointNotFound 。 我用-rdynamic选项编译了我的C ++库,我可以看到MyFunc被导出为带有nm的D标志,但这对我没有帮助。 没有任何改变,如果我只是改变DllImport(@”__Internal”到DllImport(@”mys.so”那么在linux上工作正常但是我必须在Windows中使用DllImport(@”mys.dll”这会破坏代码交叉兼容特征。 所以我想避免这种情况。 我没有看到为什么__Internal不能在Linux上工作的任何错误。 请注意,我正在使用单声道。 知道为什么这不适用于Linux吗?

为什么.NET XML将xlmns属性附加到我添加到文档的XmlElements? 我可以阻止它吗?

我正在向现有文档添加XmlElement,但正在添加一个额外的属性。 这是代码: XmlNode manifest = this.getManifestNode (); XmlElement manifestEntry = _content.CreateElement (“item”, _contentPath); XmlAttribute id = _content.CreateAttribute (“id”); id.Value = “content” + getManifestNodes ().Count; XmlAttribute href = _content.CreateAttribute (“href”); href.Value = splitPath [splitPath.Length – 1]; XmlAttribute mediaType = _content.CreateAttribute (“media-type”); mediaType.Value = “application/xhtml+xml”; manifestEntry.Attributes.Append (id); manifestEntry.Attributes.Append (href); manifestEntry.Attributes.Append (mediaType); manifest.AppendChild (manifestEntry); 以及结果XML: 哪里是 xmlns=”/home/jdphenix/epubtest/test/OEBPS/content.opf” 来自(哪里? […]

swig + mono:没有找到库的C#示例错误

我在Mac OS X 10.6.4上使用swig 2.0.1 + mono 2.6 / 2.8。 整体构建没问题,C#示例的构建也没问题。 问题是,当我运行示例(mono runme.exe)时,我总是得到以下错误。 未处理的exception:System.TypeInitializationException:类型初始化程序为examplePINVOKE抛出exception—> System.TypeInitializationException:SWIGExceptionHelper的类型初始化程序抛出exception—> System.DllNotFoundException:示例at(wrapper managed-to -native)examplePINVOKE / SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_example(examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate ,examplePINVOKE / SWIGException上的examplePINVOKE / SWIGExceptionHelper / ExceptionDelegate,examplePINVOKE […]

使用mono调用C#中的IronPython对象

我有以下IronPython代码。 class Hello: def __init__(self): pass def add(self, x, y): return (x+y) 我需要从C#调用它,我想出了以下代码。 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”); ScriptScope scope = engine.CreateScope(); script.Execute(scope); } } 复制IronPython.dll后,我运行以下命令。 (我试图运行gacutil,但是我遇到了一些错误 。 dmcs /r:IronPython.dll callipy.cs 但是我得到了一些错误信息,如下所示。 […]

系统状态C#的function

我正在寻找Mono的一般系统状态函数。 我需要的是: 记忆(可用,总计) 可用磁盘空间 IP号码 外部IP 运行进程/服务/守护进程 我怎么得到那些? 提前致谢, 伊凡

用于检查字节数组是否为零的SSE指令C#

假设我有一个byte[]并想检查所有字节是否为零。 For循环是一种显而易见的方法,而LINQ All()是一种奇特的方式,但最高性能至关重要。 如何使用Mono.Simd来加速检查字节数组是否满了零? 我正在寻找最前沿的方法,而不仅仅是正确的解决方案。

Mono.Cecil,Missing编译器需要成员’System.Runtime.CompilerServices.ExtensionAttribute..ctor’

我下载了最新的Mono.Cecil,现在每当我启动我的项目时,它都会给我错误。 如果我删除并添加mono.cecil,它就会消失。 但每次打开我的项目时都会感到痛苦。

ASP.NET Web服务器无法启动,Mono环境无法切换

我在Linux Mint上运行Monodevelop的最新版本之一,在我格式化驱动器并进行全新安装之前,它已经工作了。 当我构建我的项目时,它构建良好,但当我尝试运行它时,我收到以下消息: 无法启动ASP.NET Web服务器。 找不到xsp4 Web服务器。 请确保已安装。 我安装了xsp4和xsp4-base软件包。 我在askubuntu的问答中发现我需要切换Mono运行时才能找到xsp4。 当我转到编辑>首选项>项目> .NET运行时,我看到选项Mono 3.10.0 (Default)和Mono 3.10.0 (/usr) 。 不幸的是,当我切换到/usr (我需要并且应该工作的那个)时,我得到与上面相同的错误,无法找到Web服务器。 现在是奇怪的部分:当我再次查看.NET运行时选项时,我看到它已将默认值切换回原始值。 只有在我按下F5并尝试构建解决方案(包括发布和调试)之后,才会切换回另一个默认值。 有谁知道我怎么解决这个问题?