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. win8 需要管理员权限才能删除此应用程序

    在win8系统里面 安装了 dotfuscator,安装在c盘,结果发现运行是提示需要有管理员权限,想重新删除后安装也不行,删除的时候提示也需要管理员权限,网上查了一下资料,windows自xp开始, ...

  2. Java代码操作HDFS(在/user/root/下面創建目錄)

    1.创建HDFS目录并打成jar包 package Hdfs; import java.io.IOException; import java.net.URI; import org.apache.h ...

  3. input框中的背景文字

    <input placeholder="入库单单号" type="text" ><button>查找</button>

  4. 深入理解Javascript变量作用域

    在学习JavaScript的变量作用域之前,我们应当明确几点: a.JavaScript的变量作用域是基于其特有的作用域链的. b.JavaScript没有块级作用域. c.函数中声明的变量在整个函数 ...

  5. 自动显示git分支--安装oh-my-zsh(Ubuntu环境)

    1,安装zsh sudo apt-get install zsh 2,克隆项目 git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh- ...

  6. SSO单点登录之数据同步

    完成单点登录,我们便可以通过只登录一个账号,来访问不同系统,然而会遇到以下问题. 1. 通过A站登录的用户访问B站,在B站并没有真实用户,此时如果在B站新建用户,则可能造成用户信息不全,或者数据冲突等 ...

  7. Python初学记录

    发音: 拍怂 语系:类C 特点: 1语句控制不用{}和(),而是强制用户空格或tab缩进.空格和tab数量不一定. 2解释性语言,不需要事先声明变量,即写即用. 3.list 列表可存放多种类型数据. ...

  8. sql Server 触发器 调用java.

    在这里,通过 xp_cmdshell 调用java程序. 步骤: 1)开启 xp_cmdshell(sql Server 2008): 通过如下命令开启: -- To allow advanced o ...

  9. Android - 折线图

    使用Android的canvas,画折线图:代码为: package spt.view; import android.annotation.SuppressLint; import android. ...

  10. Oracle 11g 新特性(一)-- 虚拟列

    数据库版本: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Oracle11g 增加了虚拟列的新特性, 具体说明如 ...