vb.net 未定义类型“CrystalDecisions.CrystalReports.Engine.Section”。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16990622/
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
Type 'CrystalDecisions.CrystalReports.Engine.Section' is not defined.
提问by Daniel
Been working on an workorder application and its been going along just fine. I downloaded and install Crystal reports the other day and designed a report in my project. After coding for a bit i decided to test it out. When I rebuilt my solution in VS 2010 I suddenly came up with 66 errors.
一直在处理工单应用程序,并且进展顺利。前几天我下载并安装了水晶报表,并在我的项目中设计了一个报表。编码了一点后,我决定测试一下。当我在 VS 2010 中重建我的解决方案时,我突然想到了 66 个错误。
I have a felling the main ones are: Type 'CrystalDecisions.CrystalReports.Engine.Section' is not defined Type 'CrystalDecisions.Shared.IParameterField' is not defined. Type 'CrystalDecisions.ReportSource.ICachedReport' is not defined.
我有一个感觉,主要是: 未定义类型 'CrystalDecisions.CrystalReports.Engine.Section' 未定义类型 'CrystalDecisions.Shared.IParameterField'。未定义类型“CrystalDecisions.ReportSource.ICachedReport”。
I have searched online and it seems to be a lack of references causing this. I found a guide and located the following files:
我在网上搜索过,似乎是缺乏参考资料导致了这种情况。我找到了一个指南并找到了以下文件:
CrystalDecisions.Shared.dll
CrystalDecisions.CrystalReports.Engine.dll
CrystalDecisions.ReportSoruce.dll
Then I right clicked on my project, went to add reference, then browse, then selected those files listed above.
然后我右键单击我的项目,添加引用,然后浏览,然后选择上面列出的那些文件。
All my errors went away. Then I rebuilt my project and the 66 errors came right back. So did I add my references wrong or is there something else i need to do? I cant even build my project anymore, it just fails. If you need some of my code let me know. Im not sure what code would be relevant to this.
我所有的错误都消失了。然后我重建了我的项目,66 个错误又回来了。那么我是否添加了错误的参考资料,还是我需要做其他事情?我什至无法再构建我的项目,它只是失败了。如果您需要我的一些代码,请告诉我。我不确定哪些代码与此相关。
回答by Daniel
OK, i figured it out. It was a framework problem. Here is a where i found the answer...
好的,我想通了。这是一个框架问题。这是我找到答案的地方...
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/08287c95-5d0d-4894-8dda-e624fb088463/
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/08287c95-5d0d-4894-8dda-e624fb088463/
this is the solution...
这是解决方案...
Right click your project, select properties, under the first "Application" tab, CHANGE your "Target framework" to .net Framework 4, because the message above is saying it is currently ".net 4 Client Profile"
右键单击您的项目,选择属性,在第一个“应用程序”选项卡下,将“目标框架”更改为 .net Framework 4,因为上面的消息说它当前是“.net 4 客户端配置文件”
That dll will ONLY work if your project is .net 4 FULL profile, NOT client profile.
只有当您的项目是 .net 4 FULL 配置文件,而不是客户端配置文件时,该 dll 才有效。

