无法在单声道开发中执行类库
我使用 Visual Studio 创建了一个 C# 类库,它在 Visual Studio 中运行良好,当尝试在 Mono 开发中执行它时,出现错误
库代码:
namespace ClassLibrary2
{
public class Class2
{
public static void dosomething() {Console.WriteLine("dfss"); }
}
}
mono开发中的代码:
namespace cons
{
class MainClass
{
public static void Main (string[] args)
{
ClassLibrary2.Class2.dosomething();
}
}
}
错误
I created a C# class library using visual studio and it works well in visual studio, and when trying to execute it in mono develop I get error
the library code:
namespace ClassLibrary2
{
public class Class2
{
public static void dosomething() {Console.WriteLine("dfss"); }
}
}
the code in mono develop:
namespace cons
{
class MainClass
{
public static void Main (string[] args)
{
ClassLibrary2.Class2.dosomething();
}
}
}
the error
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你在VS中指定了什么目标框架(2.0、3.5、4.0)?看来您的单声道开发使用不同的(较低)版本。
What target framework (2.0, 3.5, 4.0) did you specify in VS?? It seems that your mono develop uses different (lower) version.
您需要检查您的.Net Framework 版本是否相同。您将在 VS 中选择一个与 Mono 开发尝试使用的框架不同的框架。这是导致此错误的一个非常常见的原因。
You need to check that your .Net Framework versions are the same. You will have chosen a framework in VS that is different to that which mono develop is trying to use. This is a very common cause of this error.
缺少的程序集是 ClassLibrary2,并且您的代码仅处理 ClassLibrary1。
也许您可以添加注册表项以启用更详细的日志记录。
The missing assembly is ClassLibrary2 and your code only deals with ClassLibrary1.
Maybe you could add the registry key to enable a more verbose logging.