1.新建一个网站

2.在网站中新建一个应用程序(名称为WcfServicesForeBayLS)

3.在应用程序高级设置中,新增协议net.tcp

高级设置->行为->已启用协议->http,net.tcp

4.编辑网站绑定,添加net.tcp类型,在绑定信息中写入808:*

5.在应用程序中,将生成的.dll文件等放入bin文件夹下,此bin文件夹在应用程序根目录下

6.新建web.config文件,将app.config文件中的内容拷贝到web.config中,并稍作修改

附上修改前和修改后的config

修改前

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="ebayAccountLS.batchingHosting" type="eBayAccountLS.Server.Config.BatchingHostingSettings,eBayAccountLS.Server" />
</configSections>
<appSettings>
<add key="AccountInfoUrl" value="http://192.168.3.36:5566/Account/GetUserVPNLoginInfo"/>
<add key="RouteInfoUrl" value="http://192.168.3.36:5566/Account/GetAllVPNServerIP"/>
</appSettings>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="portSharingBinding" portSharingEnabled="true" >
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<!--<serviceMetadata httpGetEnabled="true"/>-->
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="OtherService" behaviorConfiguration="metadataBehavior">
<endpoint address="net.tcp://127.0.0.1:4444/OtherService" binding="netTcpBinding" contract="IOtherService" bindingConfiguration="portSharingBinding" />
<!--用于发布元数据,debug时注释-->
<!--<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />-->
</service>
<service name="AccountService" behaviorConfiguration="metadataBehavior">
<endpoint address="net.tcp://127.0.0.1:4444/AccountService" binding="netTcpBinding" contract="IAccountService" bindingConfiguration="portSharingBinding"/>
<!--用于发布元数据,debug时注释-->
<!--<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />-->
</service>
<service name="PublicDuplexService" behaviorConfiguration="metadataBehavior">
<endpoint address="net.tcp://127.0.0.1:4444/PublicDuplexService" binding="netTcpBinding" contract="IPublicDuplexService" bindingConfiguration="portSharingBinding" />
<!--用于发布元数据,debug时注释-->
<!--<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />-->
</service>

</services>
<serviceHostingEnvironment>
<serviceActivations>
<add service="eBayAccountLS.Server.Services.AccountService,eBayAccountLS.Server" relativeAddress="AccountService.svc"/>
<add service="eBayAccountLS.Server.Services.OtherService,eBayAccountLS.Server" relativeAddress="OtherService.svc"/>
<add service="eBayAccountLS.Server.Services.PublicDuplexService,eBayAccountLS.Server" relativeAddress="PublicDuplexService.svc"/>
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>
<!--自定义配置节点,用于批量寄宿-->
<ebayAccountLS.batchingHosting>
<add type="eBayAccountLS.Server.Services.AccountService,eBayAccountLS.Server" />
<add type="eBayAccountLS.Server.Services.OtherService,eBayAccountLS.Server" />
<add type="eBayAccountLS.Server.Services.PublicDuplexService,eBayAccountLS.Server" />
</ebayAccountLS.batchingHosting>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

修改后

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="ebayAccountLS.batchingHosting" type="eBayAccountLS.Server.Config.BatchingHostingSettings,eBayAccountLS.Server" />
</configSections>
<appSettings>
<add key="AccountInfoUrl" value="http://192.168.3.36:5566/Account/GetUserVPNLoginInfo"/>
<add key="RouteInfoUrl" value="http://192.168.3.36:5566/Account/GetAllVPNServerIP"/>
<add key="x" value="this is X" />
</appSettings>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="portSharingBinding" portSharingEnabled="true" >
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="OtherService" behaviorConfiguration="metadataBehavior">
<endpoint binding="netTcpBinding" contract="IOtherService" bindingConfiguration="portSharingBinding" />
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
<service name="AccountService" behaviorConfiguration="metadataBehavior">
<endpoint binding="netTcpBinding" contract="IAccountService" bindingConfiguration="portSharingBinding"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
<service name="PublicDuplexService" behaviorConfiguration="metadataBehavior">
<endpoint binding="netTcpBinding" contract="IPublicDuplexService" bindingConfiguration="portSharingBinding"/>
<!--用于发布元数据,debug时注释-->
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<serviceHostingEnvironment>
<serviceActivations>
<add service="eBayAccountLS.Server.Services.AccountService,eBayAccountLS.Server" relativeAddress="AccountService.svc"/>
<add service="eBayAccountLS.Server.Services.OtherService,eBayAccountLS.Server" relativeAddress="OtherService.svc"/>
<add service="eBayAccountLS.Server.Services.PublicDuplexService,eBayAccountLS.Server" relativeAddress="PublicDuplexService.svc"/>
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

其中

<serviceHostingEnvironment>
<serviceActivations>
<add service="eBayAccountLS.Server.Services.AccountService,eBayAccountLS.Server" relativeAddress="AccountService.svc"/>
<add service="eBayAccountLS.Server.Services.OtherService,eBayAccountLS.Server" relativeAddress="OtherService.svc"/>
<add service="eBayAccountLS.Server.Services.PublicDuplexService,eBayAccountLS.Server" relativeAddress="PublicDuplexService.svc"/>
</serviceActivations>
</serviceHostingEnvironment>

功能在于,支持无.svc文件的服务激活

更详细的内容自行查阅

客户端终结点

<endpoint name="otherServiceEndPoint" address="net.tcp://192.168.3.36/WcfServicesForeBayLS/OtherService.svc" binding="netTcpBinding" contract="IOtherService" bindingConfiguration="portSharingBinding"/>

转载于:https://www.cnblogs.com/Plantastic/p/3542675.html

wcf部署,通过IIS寄宿服务(net.tcp),免svc文件。相关推荐

  1. django+boostrap项目部署在IIS上出现找不到woff2文件404错误

    django+bootstrap项目正式部署到IIS服务器上后总是出现woff2文件找不到,查找相应文件也是存在的,但是一直报错,很无奈. 后来再查了度娘之后才发现这是IIS服务器的一个bug,它本身 ...

  2. WCF 部署在IIS上

    一. 环境vs2010,WCF应用程序,server 2008 第一步:WCF项目右键点击项目,选择生成部署包,如下图: 第二步:WCF项目上右键,选择:在windows资源管理器中打开文件夹,如下图 ...

  3. [WCF 4.0新特性] 标准终结点与无(.SVC)文件服务激活

    今天介绍WCF 4.0的另外两个新特性:标准终结点(Standard Endpoint)和无(.SVC)文件服务激活(File-Less Activation).前者实现了针对典型通信场景对终结点的定 ...

  4. WCF部署到IIS不使用svc文件

    <?xml version="1.0" encoding="utf-8"?> <configuration> <system.we ...

  5. WCF部署到IIS异常(详细: 不能加载类型System.ServiceModel.Activation.HttpModule )

    未能从程序集"System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&q ...

  6. 部署在IIS上的程序,可以找到文件夹,能看到文件却报404

    问题:在.NET中,我写了一个方法去获取项目中的json文件,在指定的文件夹下面有这个json文件,但是程序一直报404,就很纳闷,以为老天针对我呢,后来在网上找了很久终于发现了问题,原来就是IIS的 ...

  7. 第一章 基础 (续 在IIS中寄宿服务)

    在IIS中寄宿服务 一个WCF服务可以在操作系统中运行的任何托管进程中寄宿.服务本身一般并不知道或者关心它是怎么被寄宿的,尽管它可以通过丰富的APIs来找出来.它可以寄宿到一个不被注意的随机器初始化时 ...

  8. 【转】WCF Data Service 使用小结(二) —— 使用WCF Data Service 创建OData服务

    在 上一章 中,介绍了如何通过 OData 协议来访问 OData 服务提供的资源.下面来介绍如何创建一个 OData 服务.在这篇文章中,主要说明在.NET的环境下,如何使用 WCF Data Se ...

  9. WCF Data Service 创建OData服务

    WCF Data Service 是需要 ORM 的支持的, 主流的 ORM 都已经支持 WCF Data Service 了, Entity Framework.Linq to SQL.ALinq  ...

最新文章

  1. 【puthon】把大量csv文件写入h5文件制作数据集
  2. DOM(Document object madle) 文档对象模型: 元素节点 文本节点 属性节点
  3. C++tim Sort提姆排序的实现算法(附完整源码)
  4. SAP UI5 Focus related
  5. 简要描述内部连接和外部连接之间的区别_sqlserver的几种常见连接方法
  6. java开源笔记软件下载_开发常用软件笔记 - ZhaoQian's Blog - OSCHINA - 中文开源技术交流社区...
  7. C/C++面试题—矩阵中的路径【回溯法应用】
  8. 中年程序员对核心竞争力“不可替代”的重新认识
  9. Android Studio(7)---从模板添加代码
  10. 深度学习笔记_基本概念_Depthwise卷积与Pointwise卷积
  11. 深入浅出数据分析----- 学习笔记
  12. 从NFC卡(校园卡或者门禁卡)分析看ACR122U读写原理 (转载)
  13. Visio实用技巧总结
  14. AlexNet、VGG16、ResNet网络结构图
  15. 谈一下MVVM 框架
  16. 小白跑WRF第五天,安装WPS和静态地理数据
  17. Godaddy、Lunarpages、IXwebhosting国外三大主机点评
  18. 特斯拉新汽车工厂拟落户美国德州,生产电动皮卡
  19. [k8s集群系列-09]Kubernetes 组件 Dashboard
  20. 液晶显示屏选型重点参数

热门文章

  1. ARM-DAPLINK 仿真器硬件解析
  2. oracle转当年时间,oracle-20SEP-日期格式转换为9-20,并比较大小
  3. Apollo自动驾驶开发笔记47——apollo编译报错this rule is missing dependency declarations for the following files
  4. 一起来看流星雨剧情简介/剧情介绍/剧情分集介绍第十二集
  5. SEEDLAB2.0-Spectre Attack Lab
  6. intel8/9代cpu Win7 USB3驱动 集显驱动
  7. SuperMap热力网格图
  8. android中radiogroup作用,Android View系列---RadioGroup与RadioButton
  9. Monkey测试进阶
  10. 【附源码】计算机毕业设计java校园摄影爱好者交流网站设计与实现