vb.net 导入“iTextSharp.text.SimpleTable”错误中指定的命名空间或类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15260817/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Namespace or type specified in the Imports 'iTextSharp.text.SimpleTable' error
提问by user2142159
I am using Visual Studio Pro 2005 trying to access iTextSharp.dll to convert HTML to PDF. The problem is that VS will not recognize the DLL returning this message:
我正在使用 Visual Studio Pro 2005 尝试访问 iTextSharp.dll 以将 HTML 转换为 PDF。问题是 VS 无法识别返回此消息的 DLL:
"Namespace or type specified in the Imports 'iTextSharp.text' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases."
“导入‘iTextSharp.text’中指定的命名空间或类型不包含任何公共成员或无法找到。确保命名空间或类型已定义并包含至少一个公共成员。确保导入的元素名称不包含”不要使用任何别名。”
This prevents any access to the object in my .Net VB code. iTextSharp version is 5.4.0 I downloaded today.
这可以防止对我的 .Net VB 代码中的对象进行任何访问。iTextSharp 版本是我今天下载的 5.4.0。
The problem is in both the components needed:
问题在于所需的两个组件:
- Imports iTextSharp.text
- Imports iTextSharp.text.pdf
- 导入 iTextSharp.text
- 导入 iTextSharp.text.pdf
Any ideas?
有任何想法吗?
回答by Robin G Brown
I had a similar problem with CuteFM32.dll. The reference in the VB.NET project was pointing to \obj\debug\interop.cuteformcolib.dllbut I think that when I ran the Build > Clean solution command it removed the dll and thus the reference was no longer valid. Note that 'Copy Local' was set to False for the reference to this DLL.
我有一个与CuteFM32.dll 类似的问题。VB.NET 项目中的引用指向,\obj\debug\interop.cuteformcolib.dll但我认为当我运行 Build > Clean solution 命令时,它删除了 dll,因此引用不再有效。请注意,'Copy Local' 设置为 False 以引用此 DLL。
Fortunately simply removing and adding the reference worked for me but I had to turn on 'Show All files' in order to see that the imported DLL was missing.
幸运的是,简单地删除和添加引用对我有用,但我必须打开“显示所有文件”才能看到导入的 DLL 丢失了。
回答by djv
Since the reference works with a new project, make a new project and add all your classes, forms, etc., checking that the reference still works as you go. Either you will add everything and the problem is solved, or you will find what created issues.
由于参考适用于一个新项目,因此请创建一个新项目并添加所有类、表单等,检查参考在您进行时是否仍然有效。要么您添加所有内容并解决问题,要么您将找到造成问题的原因。

