在C#中使用vb.dll [英] use vb.dll in C#
本文介绍了在C#中使用vb.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的MVC5项目中,我使用一些vb文件作为dll文件。我可以从 中读取原始代码他们建立的另一个项目。现在我无法初始化其中一个类,我的Visual Studio中的错误消息是:
In my MVC5-project I use some vb-files as dll-files. I can read the original code from the other project where they are build. Now I cannot initialize one of the classes, the error message in my Visual Studio is:
错误 CS1729
'CDatabaseConfig'不包含带有1个参数的构造函数
Error CS1729 'CDatabaseConfig' does not contain a constructor that takes 1 arguments
我想调用类CDatabaseConfig的构造函数在VB中
I want to call this constructor of class CDatabaseConfig in VB
Private Sub New(ByVal bSecondServer As Boolean)
在C#中使用该语句
CDatabaseConfig databaseConfig = new CDatabaseConfig(false);
有什么问题?
提前感谢
Ottilie
推荐答案
该构造函数是私有的。因此,无论VB / C#语言如何,您都无法在CDatabaseConfig类之外调用它!
That constructor is private. So you can't call it outside of the CDatabaseConfig class at all, regardless of VB/C# language!
这篇关于在C#中使用vb.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文