2012-12-11 57 views
0

我有一个Web站点,上面有一个Service.svc文件,我使用添加新项目 - >支持AJAX的WCF服务创建了这个数周,一切正常。 今天,我导入EPplus.dll来生成一些excel文件。当我尝试编译我得到这个错误使用Epplus和Service.svc时出现问题

Error 1 Reference.svcmap: 
Failed to generate code for the service reference 'QUAY.Tractebel.COP.Servicos'. 
Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: 
System.ServiceModel.Description.DataContractSerializerMessageContractImporter 
Error: Type 'OfficeOpenXml.ExcelRangeBase' is a recursive collection data contract which is not supported. 
Consider modifying the definition of collection 'OfficeOpenXml.ExcelRangeBase' to remove references to itself. 
XPath to Error Source: //wsdl:definitions[@targetNamespace='']/wsdl:portType[@name='Servicos'] App_WebReferences/QUAY/Tractebel/COP/Servicos/ 

我不知道如何解决它,有人可以帮助我吗?

回答

3

刚才引用我使用的自定义wcf类时也有同样的问题。 奇怪的问题是,在我的旧开发电脑(Windows Vista的32位,Visual Studio 2010)我没有得到这个问题,它只弹出在我的新系统(Windows 8 64位)。 Bah。

但是,我绕过这个问题打开App_WebReferences - >“服务名称” - >右键单击视Refrence图标 - >“配置服务引用”

在此屏幕从移动选项按钮“重用类型的所有引用assembiles”到‘重用类型指定组件’,检查所有依赖库EXCEPT EPPlus

编译和...瞧

如果someon也有一个逻辑的解释,我会很乐意听

相关问题