http://sandrinodimattia.net/fixing-common-issues-when-hosting-a-net-4-0-wcf-service-in-iis-7/

Until today I never had to host a WCF service in IIS… I always prefered using a ServiceHost in a Windows Service. Before getting my service up and running I had to face some issues.

Could not load file or assembly ‘service’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

The problem here is that I’m running a .NET 4.0 service in a .NET 2.0 IIS and AppPool. I had to make the following changes:

  • Change the IIS .NET Framework version to v4.0.30319 (click on the machine name in IIS Manager and in the right pane choose Change .NET Framework Version)
  • Change the .NET Framework version of the AppPool too v4.0 (via Application Pools) or create a new Application Pool.

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Detailed Error InformationModule StaticFileModule.

The reason for this issue: the ServiceModel for .NET 4.0 was not installed. Run ServiceModelReg.exe -ia to solve this. 
Depending on your machine and the .NET version you are running the file could be in one of the following locations:

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\

Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list

    1. This means that ASP.NET 4.0 was not installed (correctly). Run aspnet_regiis.exe -i using Visual Studio Command Prompt (2010) or via "C:\Windows\Microsoft.NET\Framework\v4.0.30319".
    2. I also had to install the WCF Activation feature under .NET Framework 3.5.1 Features

Fixing common issues when hosting a .NET 4.0 WCF service in IIS 7的更多相关文章

  1. WCF - Hosting WCF Service

    After creating a WCF service, the next step is to host it so that the client applications can consum ...

  2. Learning WCF Chapter1 Hosting a Service in IIS

    How messages reach a service endpoint is a matter of protocols and hosting. IIS can host services ov ...

  3. WCF - Hosting WCF Service 四种托管方式

    https://www.tutorialspoint.com/wcf/wcf_hosting_service.htm After creating a WCF service, the next st ...

  4. Common Issues Which Cause Roles to Recycle

    This section lists some of the common causes of deployment problems, and offers troubleshooting tips ...

  5. (WCF) WCF Service Hosting.

    3 Options. 1. Host inside of an application. 2. Host into Windows service. 3. Host into IIS 参考: http ...

  6. Hosting WCF Service

    之前在博客几个实例DemoWCF服务寄宿到控制到应用程序中,这篇来总结一下,经常使用的几种宿主的方式. 1.Self-Hosting 一个WCF服务可以寄宿在控制台应用程序或者WinForms app ...

  7. WCF - IIS Hosting

    WCF - IIS Hosting Hosting a WCF service in IIS (Internet Information Services) is a step-by-step pro ...

  8. Unity文档阅读 第三章 依赖注入与Unity

    Introduction 简介In previous chapters, you saw some of the reasons to use dependency injection and lea ...

  9. Deploying an Internet Information Services-Hosted WCF Service

    Deploying an Internet Information Services-Hosted WCF Service .NET Framework 4   Other Versions .NET ...

随机推荐

  1. checkbox复选框

    改变checkbox状态 所有的jquery版本都可以这样赋值:// $("#cb1").attr("checked","checked") ...

  2. 调试php的soapServer

    用.NET的webservice做调试很轻松. 用soapserver的try和cacth获取不了多少信息

  3. js获取元素transform参数得出的个人理解

    之前写页面的时候有试过想用js获取某些元素的translate的数值什么的,但是translate又是transform的子样式(勉强说说),理所当然就是先获取transform样式,再读里面的值. ...

  4. [DEncrypt] RSACryption--RSA加密/解密字符串 (转载)

    点击下载 RSACryption.zip 这个类是关于加密,解密的操作,文件的一些高级操作1.RSACryption RSA 的密钥产生2.RSACryption RSA的加密函数3.RSACrypt ...

  5. oracle查询最占用资源的查询

    从V$SQLAREA中查询最占用资源的查询 select b.username username,a.disk_reads reads,a.executions exec,a.disk_reads/d ...

  6. 应用程序中小红点设置方法 (ios)

    我们的手机上常常会看到软件的右上角出现小红点,上面显示着你未读的消息数.下面是设置小红点的方法. 1.tabBar上按钮的小红点      因为小红点代表你未读的消息数,所以这个小红点上的数据不是凭空 ...

  7. STP根交换机,指定端口,根端口,阻塞端口

    STP判断各交换机端口(指定端口:DP;根端口:RP;阻塞端口:AP) 判断步骤: 1.选举根交换机: 判断对象:所有运行STP协议的交换机中选出一个; 判断依据:交换机中选择网桥ID值(交换机优先级 ...

  8. 输出不大于N的素数的个数

    输出不大于N的素数的个数 Sieve of Eratosthenes 方法  素数的性质: 非素数可以分解为素数乘积. 证明 (1)n = 2 成立,n = 3 成立: (2)若 n = k 时成立, ...

  9. C 语言 printf格式控制详解

    闲来无事,整理了一下C语言printf() 的格式控制语句. PS:详细来源于网络. printf的格式控制的完整格式: %  -  0  m.n  l或h  格式字符 下面对组成格式说明的各项加以说 ...

  10. Bayeux协议

    Bayeux 协议-- Bayeux 1.0草案1 本备忘录状态 This document specifies a protocol for the Internet community, and ...