将WCF数据服务部署到IIS时获取System.InvalidOperationException [英] Get System.InvalidOperationException when deploy WCF Data Service to IIS

查看:193
本文介绍了将WCF数据服务部署到IIS时获取System.InvalidOperationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经使用新的Wcf数据服务CTP2版本创建了一个新的数据服务.数据服务可以在我的本地IIS和VS2010开发环境中正常运行.但是,当我尝试将服务发布到测试服务器时,出现错误:

Hi,

I''ve created a new data service using the new Wcf Data Services CTP2 release. The data service runs fine on my local IIS and in VS2010 dev environment. However, when I try and publish the service to a test server, I get the error:

The type 'Marshalls.CustomerContactsService.DataService.CustomersContactsDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The type 'Marshalls.CustomerContactsService.DataService.CustomersContactsDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.



我已将DataServiceProtocolVersion设置为v3,并且所有必需的dll位于服务的bin文件夹中.我已经调整了我在IIS中可以想到的所有设置,但似乎没有任何效果.我以前发布过几种WCF数据服务,但是都没有问题,但这是我创建的第一个使用新CTP2 dll的服务.

还有其他人有类似的问题吗?

在此先感谢

Ryan



I''ve set the DataServiceProtocolVersion to v3, and all the required dlls are present in the bin folder of the service. I''ve tweaked every settin I can think of in IIS but nothing seems to work. I''ve published several WCF Data services previously without issue, but this is the first one I''ve created that uses the new CTP2 dlls.

Has anyone else has a similar issue?

Thanks in advance

Ryan

推荐答案

辛苦了之后,我终于找到了问题所在.底层实体模型是使用EF4.1构建的,而EF4.1尚未安装在Web服务器上.安装EF4.1解决了该问题.
After much toil I''ve finally found the problem. The underlaying Entity Model is built using EF4.1, which wasn''t installed on the web server. Installing EF4.1 resolved the issue.


这篇关于将WCF数据服务部署到IIS时获取System.InvalidOperationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆