无法在单声道开发中执行类库

发布于 2025-01-03 06:50:45 字数 548 浏览 3 评论 0原文

我使用 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
the error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

好倦 2025-01-10 06:50:45

你在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.

帅气尐潴 2025-01-10 06:50:45

您需要检查您的.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.

草莓味的萝莉 2025-01-10 06:50:45

缺少的程序集是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文