是否有可能从DLL导入的C#类在vb.net的dll? [英] Is it possible to import c# classes from dll in a vb.net dll?

查看:131
本文介绍了是否有可能从DLL导入的C#类在vb.net的dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • IDE:VS2010

  • Framework.net:4.0

我的Visual Studio 2010下创建一个C#DLL项目中,有几个公开课,我想用在另一个dll项目的类,但写在vb.net。

I created a c# dll project under Visual Studio 2010, with several public classes, and I would like to use its classes inside another dll project, but written in vb.net.

在vb.net dll项目,我引用内置C#DLL,但不可能导入C#类。 C#的DLL的命名空间,甚至无法识别。

In the vb.net dll project, I referenced the built c# dll, but impossible to import the c# classes. The namespace of the c# dll is even not recognized.

我必须做的看到我的C#类?
。如果这是可能的。

What must I do to see my c# classes? If this is possible.

类我的C#DLL(命名空间MyCSharpDll)的例子:

Example of class of my c# dll (namespace MyCSharpDll):

namespace MyCSharpNamespace {
  public class MyCSharpClass {
    public void Test() {}
  }
}

例如:

Imports MyCSharpDll.MyCSharpNamespace

VS2010指示错误说MyCSharpDll不明或无公共成员。

VS2010 indicates an error saying that MyCSharpDll is unknown or no public member.

感谢您。

推荐答案

我觉得你应该重写进口

进口MyCSharpNamespace

Imports MyCSharpNamespace

没有'MyCSharpDll的一部分

without 'MyCSharpDll' part

这篇关于是否有可能从DLL导入的C#类在vb.net的dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆