是否可以从 vb.net dll 中的 dll 导入 c# 类?

Ala*_*ain 5 c# vb.net dll reference visual-studio-2010

  • 集成开发环境:VS2010
  • 框架网:4.0

我在 Visual Studio 2010 下创建了 ac# dll 项目,其中包含几个公共类,我想在另一个 dll 项目中使用它的类,但用 vb.net 编写。

在vb.net dll项目中,我引用了构建的c# dll,但无法导入c#类。C# dll 的命名空间甚至无法识别。

我必须做什么才能查看我的 C# 类?如果这可能的话。

我的 c# dll 类的示例(命名空间 MyCSharpDll):

namespace MyCSharpNamespace {
  public class MyCSharpClass {
    public void Test() {}
  }
}
Run Code Online (Sandbox Code Playgroud)

我的 vb.net dll 文件中的示例:

Imports MyCSharpDll.MyCSharpNamespace
Run Code Online (Sandbox Code Playgroud)

VS2010 指示错误,指出 MyCSharpDll 未知或没有公共成员。

谢谢。

Ste*_*eve 5

我认为你应该重写你的导入

导入 MyCSharp 命名空间

没有“MyCSharpDll”部分