简体   繁体   English

将C#类库引用添加到VB.Net Project

[英]Add C# class library reference to VB.Net Project

I have a VB.Net Windows form application. 我有一个VB.Net Windows窗体应用程序。 I have added a C# class library to the solution that has VB.Net Windows form application. 我已经为具有VB.Net Windows窗体应用程序的解决方案添加了一个C#类库。 I compiled C# class library and have added reference to VB.Net windows form application. 我编译了C#类库,并添加了对VB.Net windows表单应用程序的引用。 However when I am trying to add namespace of C# class library it just doesn't show up in the intellisense. 但是,当我尝试添加C#类库的命名空间时,它只是没有出现在intellisense中。 Hence I was unable to access C# class and it's functions as well. 因此我无法访问C#类,它也是函数。 Someone please tell me a fix for this. 有人请告诉我一个解决方法。 Thank you 谢谢

Assuming the dll in question is CLS compliant and compiled against the same runtime version, you should be able to use it without a problem. 假设有问题的DLL 符合CLS并针对相同的运行时版本进行编译,您应该能够毫无问题地使用它。

If either (or both) of these conditions are not met, you will not be able to use the imported DLL. 如果不满足这些条件中的任何一个(或两个),您将无法使用导入的DLL。

Make sure the Import directive uses the namespace as defined in the assembly metadata - look at your C# project properties to see what the default namespace is, that's what you need to import. 确保Import指令使用程序集元数据中定义的名称空间 - 查看C#项目属性以查看默认名称空间是什么,这是您需要导入的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM