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. window和Linux下的软链接

    window下开启软链接命令: mklink /J  "D:\IdeaProjects\bms_work\smartcity_govnet\base_web\target\base_web\ ...

  2. Linq扩展方法之Aggregate 对序列应用累加器函数

    Linq扩展方法之Aggregate  对序列应用累加器函数; 函数模板:// 函数名:对序列应用累加器函数. // Parameters:参数要求 // source:要聚合的 System.Col ...

  3. js跨浏览器事件对象、事件处理程序

    项目中有时候会不用jquery这么好用的框架,需要自己封装一些事件对象和事件处理程序,像封装AJAX那样:这里面考虑最多的还是浏览器的兼容问题,原生js封装如下:var EventUtil={ //节 ...

  4. SQL Server备份还原数据库中的小把戏

    备份数据库时出现一个不太了解的错误 ,错误信息“is formatted to support  1 media families, but 2 media families are expected ...

  5. HDU1557权利选举

    /* 思路:遍历所有2^n个集合,对于每个集合求票和,如果满足票为优胜团体,而再对集合每个成员比较,是否满足变成非优胜团体,是的话,对于该成员对应结果+1. 重点:利用二进制思想,所有团体均对应0~2 ...

  6. 简单的背包变形HDU1203,HDU2955

    今天一直在写背包,不过中间停了一段时间在写shell. 一直在做01背包.今天做了这两题很相似的背包 首先是HDU1203 Speakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要 ...

  7. Codeforces 551D GukiZ and Binary Operations(矩阵快速幂)

    Problem D. GukiZ and Binary Operations Solution 一位一位考虑,就是求一个二进制序列有连续的1的种类数和没有连续的1的种类数. 没有连续的1的二进制序列的 ...

  8. 【实习记】2014-08-24实习生无法映射磁盘替代方案rsync+非默认端口22设置

    正职开发人员有两个电脑,一个办公网的,一个开发网的.通过samba服务在开发网机器上映射编译环境机的磁盘没有问题. 开发岗实习生使用虚拟机做跳板方式登录编译环境机.上面的方法不能用. 替代方法:rsy ...

  9. (一)跟我一起玩Linux网络服务:DNS服务——BIND(/etc/named.conf、/var/named)设置实现和解释

    2015年3月24更新 添加了要加的配置域名解析器(否则会找不到域名)     一.创建该实验的的模型   配置完gate虚拟机的两张网卡后,就启动gate的转发 [root@localhost ro ...

  10. php函数应用场景

    截取文件后缀: $slen = strlen($suffix); substr($this->uri_string, -$slen) === $suffix 原理:截取倒数多少长度字符 判断多维 ...