无法显示IIS页面中的WCF服务部署,SVC文件如何工作? [英] WCF Service Deployment in IIS Page cannot be displayed and how does the SVC file work?

查看:684
本文介绍了无法显示IIS页面中的WCF服务部署,SVC文件如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Arghhh!我非常沮丧地试图绕过这个WCF服务。

Arghhh! I'm getting so frustrated trying to get my head around this WCF service.

所以我创建了一个WCF服务。它在我的笔记本电脑中工作正常,我从Visual Studio 2010启动它。现在我必须在Windows Server 2003机器上部署它。所以我在该服务器的IIS上创建了一个虚拟目录。接下来我将WCF服务DLL文件复制到虚拟目录中。我还创建了一个SVC文件,其中包含以下条目:

So I created a WCF service. It works fine in my laptop where I launch it from Visual Studio 2010. Now I have to deploy it on a Windows Server 2003 machine. So I created a virtual directory on that server's IIS. Next I copied the WCF Service DLL file in the virtual directory. I also created an SVC file which had the following entry:

<%@ ServiceHost Language="C#" Service="AMWCF.Service1" %>

首先,我很困惑。这行告诉服务器DLL文件在哪里?它只是说AMWCF.Service!不是文件位置!

所以当我尝试启动我的网页时,会出现错误无法显示页面。我已经尝试了在网上找到的所有东西,包括:

So when I try to launch my webpage, it gives an error "THE PAGE CANNOT BE DISPLAYED". I've tried everything which I can find on the net including:


  1. 重新安装ServiceModelReg

  2. 限制IIS

  3. 在IIS中允许ASP.NET

对不起,在这里显示我的沮丧。我真的非常感谢任何帮助。多谢你们。你们是最好的

Sorry for showing my frustration here. I really really reallllly appreciate any help. Thanks guys. You guys are the best

推荐答案

如果你的WCF服务有一个类库,你需要将服务DLL复制到虚拟目录中的 .\bin 文件夹一级降级。这是WCF运行时查找其服务类的地方。

If you have a class library with your WCF service inside, you need to copy the service DLL into the .\bin folder one level down from your virtual directory. That's where the WCF runtime looks for its service classes.

另请参阅这些资源:

  • MSDN docs: How to: Host a WCF Service in IIS
  • endpoint.tv Screencast - Hosting WCF Services in IIS

MSDN上的WCF开发人员中心有一个初学者指南(可从登陆页面直接提供),其中优秀的5- 10分钟的截图,向您解释WCF的所有东西 - 强烈推荐!

The WCF Developer Center on MSDN has a "Beginnger's Guide" (available right from the landing page) which has tons of those excellent 5-10 minute screencasts explaining all things WCF to you - highly recommended!

这篇关于无法显示IIS页面中的WCF服务部署,SVC文件如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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