0

我有一个 WCF 服务项目,我试图在我的本地开发机器上启动并运行它。

当我从在 Cassini 中运行的 IE8 中点击 .SVC 时,它没有问题。

当我从在 IIS 中运行的 IE8 中点击 .SVC 时,我收到以下服务器错误。

该服务实施“2”合同。要使用 WebScriptServiceHostFactory,您必须为每个服务实现一个协定。如果您必须使用多个合同,请使用常规的 ServiceHost。

我的 IIS 配置似乎有问题。我有一个同事在他的机器上通过 IIS 运行项目,我们已经检查并匹配了我们的 Windows 功能列表,以确保我们在 Windows 7 中安装了相同的 IIS 和 WWW 功能。

我还用 IIS 为 4.0 重新注册了 aspnet,但错误没有改变。

4

1 回答 1

0

Well, the a reason why works in Cassini and not in IIS7 is that Cassini emulates IIS6 and there have been a significant number of changes to website configuration between IIS6 and IIS7. You should most definitely install and use IIS Express 7.5 as your integrated development web host the instead of the default Cassini browser.

Now, you've checked your features but have you checked your IIS7 configuration? Are you sure that the site is running in the correct (.NET 4) app pool. Have you also ensure that it is running in the correct mode (Integrated).

于 2012-05-22T11:39:44.287 回答