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

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

问题描述

啊!我在试图了解这个 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 复制到 .in 文件夹 <强>比您的虚拟目录低一级.这就是 WCF 运行时寻找其服务类的地方.

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

另见这些资源:

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天全站免登陆