- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将单声道嵌入到 C++ 可执行文件中,但单声道在 Assembly.GetExecutingAssembly 上崩溃。知道我错过了什么吗?
编辑:使用单声道 3.0.3
嵌入式单声道测试.cpp :
// EmbeddedMonoTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/exception.h>
#include <mono/jit/jit.h>
#include <mono/metadata/assembly.h>
int _tmain(int argc, _TCHAR* argv[])
{
MonoDomain* domain = mono_jit_init_version ("ClassLibrary1", "v4.0.30319");
MonoAssembly* _assembly_fbmonoengine = mono_domain_assembly_open (domain, "ClassLibrary1.dll");
MonoImage* _image_fbmonoengine = mono_assembly_get_image (_assembly_fbmonoengine);
MonoClass* klass = mono_class_from_name(_image_fbmonoengine, "ClassLibrary1", "Class1");
MonoMethod* test = mono_class_get_method_from_name(klass, "Test" , 0);
mono_runtime_invoke(test, NULL, NULL, NULL);
return 0;
}
Class1.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace ClassLibrary1
{
public class Class1
{
public static void Test()
{
Assembly.GetExecutingAssembly();
}
}
}
错误:
Unhandled exception at 0x65ad2148 in EmbeddedMonoTest.exe: 0xC0000005: Access violation reading location 0x`00000008.
最佳答案
您没有在程序中执行任何程序集,因此该上下文中的 ExecutingAssembly 没有任何意义(尽管需要更好的错误)。您需要在程序集中提供通常的静态 Main() 入口点并使用 mono_runtime_exec_main() 执行它。
关于mono - Assembly.GetExecutingAssembly() 在嵌入式单声道中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14915863/
Mono 适合开发服务器应用程序,还是只适合开发桌面应用程序?我想用 C# 为 Linux 开发服务器应用程序。我想用 C#/XNA 编写一个第一人称射击 (FPS) 游戏,并且我有一个 Linux
今天我的 Ubuntu 将 Mono 更新到了 4.2.1.102。它不会允许我绝对需要运行的某个程序。如何将其降级到 4.0.5.1?我已经尝试过了... sudo apt-get install
我最近一直在使用 Java 中的 react 器库和 Spring 框架学习响应式(Reactive)编程,并且在很大程度上我已经能够掌握它。然而,我发现自己多次遇到同样的情况,并希望得到一些关于我哪
虽然 Mono 支持对我们来说不是什么大问题,但我认为 OpenRasta 支持它,因为它有一些关于它的提交消息.. 好吧,我尝试在 Mono 上构建它并获得了模棱两可的类型引用(在手动创建了 10
如何使用单声道嵌入调用创建通用 List 对象?我可以得到 List 的 MonoClass: MonoClass* list = mono_class_from_name(mscorlibimage
我正在考虑使用 Mono.Cairo 作为轻量级 CAD 系统的基础。 但不知道表现如何。 CAD 系统产生了很多 重绘并且可以在其中包含大量数据和大量文本。 如果不是开罗,那么欢迎任何其他建议。 我
我花了一周的时间尝试让我的 XSP 服务器处理简单的静态内容:html 页面、js 文件、gif、jpegs 等...没有 ASP.NET。当使用浏览器浏览此页面时,该服务器总是随机崩溃。我的环境是:
我想确定构建和安装当前 Mono 运行时的版本(如何在 Git 中正确调用它?)。 $ dmcs --version Mono C# compiler version 2.9.0.0 但这绝对不够。
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 10 年前关闭。 Improve this
我已经在 ubuntu 14.0 lts 中下载并安装了 vscode,并包含了现有的 node.js 项目。首先认为我必须使用 vscode 调试我的应用程序,为此我必须调试(ctrl+shift+
嗨,我刚刚开始学习响应式编程 我这里有这段代码,我的流程应该是我将调用 tokenRepository 来获取 token ,然后使用 token.getAccessToken() 用作 cardRe
几天来,我一直在尝试在 Centos 6.3 上运行的 XSP 2.10 软件包中获取 mono 3.0 和 nginx 1.2.4 和 fastcgi-mono-serverX ...XSP4 服务
我正在尝试使用 Mono 创建一个 Mac 包。当我执行时: mkbundle file.exe --deps -o FILE 我在编译过程中得到了这个: fatal error: "
Mono 2.0 was just officially released .您认为最重要的单一功能是什么? 最佳答案 Windows.Forms 绝对领先...这可能是我最兴奋的功能。 LINQ-t
我正在将我的应用程序更新到 ios6,但我遇到了以下问题 无法通过架构构建应用程序 支持 ARMv6 + ARM v7 但仅支持 ARM v7(错误是 iOS6 与 ARM v6 不兼容)。这意味着我
你好,我有 CentOS,我正在尽我最大的努力更新 Mono,我目前有 1.2.4 版,我试图通过 xbuild 编译一些东西,但我想它不起作用,因为我正在使用旧版本的单声道。 请在将任何指南链接到我
我正在尝试使用以下代码创建包含名称(作为标签)和关闭按钮(作为带有图像的按钮)的新 GTK Notebook 选项卡: Label headerLabel = new Label(); headerL
我正在为需要使用 AppleScript 的 OSX 编写一个单声道应用程序。我正在使用 AppleScript class from the Monodevelop source大多数情况下都可以正
我正在尝试构建一个控制台应用程序来测试 redis/mono 通信。我一直在使用 Monodevelop 4.0 (Xamarin Studios)+Nuget Port 在 mac os 上与 Se
为了摆脱软 float 与硬 float ABI 问题,我尝试在我的 Raspberry Pi 上安装最新版本的单声道 git clone https://github.com/mono/mono.g
我是一名优秀的程序员,十分优秀!