How to make a simplest WCF service work on Win7 with VS2010
You know as a beginner to learn WCF, the first thing is to make a simplest WCF service work like a classic "Hello World" console application. Now I will introduce the steps by following:
1.Create a "WCF Application Service" like this:
2. Rename the "IService1" to "ICalculatorService" and "Service1" to "CalculatorService" for both project file name and interface/class name in source code, and then update the generated code by default to following:

3. Set as start page for "CalculatorService.svc" and then hit F5 to lauch the WCFServiceTestClient

4. Open IIS and "Sites->Add Website...", click OK button as below:

5. Right click the new added site and select "Add Virtual Directory...", after that, switch to "Content View" you can see below:

6. Right click the new added virtual directory "Calculator" and then select "Convert to Application", click OK button
7. Right click the converted "Calculator" and then "Manage Applicataion->Browse"
8. If happen below error, need to change the Application Pool's .NET framework version to 4.0 as following:

9. If happen below error, need to enable the "Directory Browsing" as the guided steps:

10. Repeat step7 and then click the link "CalculatorService.svc", if you can see the second picture, congratulations!


11. If you are failed to see above picture, probably some ASP.NET components are not installed, so please first check if the 6 items are existing:

If not, please make sure below features are installed:



12. Below is the optional steps, if above doesn't work:
Run cmd as administrator and then cd to "C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation", execute below commandline:
ServiceModelReg.exe -i
If above step generate any bad impact/result, I mean browse the created WCF service will happen some strange errors, we can rollback by executing below commandline:
ServiceModelReg.exe -u
13. Another optional step is(probably it doesn't need to do):

14. I believe the WCF service is published successfully be above several steps given, from then on, I will create a console applicaiton named "CalculatorClient" to consume the published WCF service.

14. Right click "References" and then select "Add Service Reference...", input the WCF service address and then click "OK" button:

15. Add client code to call WCF service, the calling result is showed as below picture, till now our first WCF learning sample is done here. :)
How to make a simplest WCF service work on Win7 with VS2010的更多相关文章
- 如何创建一个RESTful WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4044813.html 转载请注明出处 (一)web.config文件 要创建REST WCF Service,endpoin ...
- 如何创建一个AJAX-Enabled WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4041638.html 转载请注明出处 前面的文章中介绍过<Step by Step 创建一个WCF Servi ...
- 用JavaScript调用WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4039604.html 转载请注明出处 前面介绍过<Step by Step 创建一个WCF Service>和& ...
- Step by Step 创建一个WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4025448.html 转载请注明出处 (一)创建WCF Service (1)创建WCF Service类库 创建一个Cla ...
- Deploying an Internet Information Services-Hosted WCF Service
Deploying an Internet Information Services-Hosted WCF Service .NET Framework 4 Other Versions .NET ...
- Azure开发者任务之六:使用WCF Service Web Role
在本文中,我们将会在local development fabric上创建一个WCF服务角色,然后在一个控制台应用程序中使用它. WCF服务角色可以让我们创建一个WCF服务,并且把它托管在Window ...
- WCF - Consuming WCF Service
WCF services allow other applications to access or consume them. A WCF service can be consumed by ma ...
- WCF - Hosting WCF Service
After creating a WCF service, the next step is to host it so that the client applications can consum ...
- WCF - Creating WCF Service
http://www.tutorialspoint.com/wcf/wcf_creating_service.htm Creating a WCF service is a simple task u ...
随机推荐
- CentOS7 yum安装zabbix3.2.6
前言: 本人小白,在一个多月前通过面试进入公司,在进入公司的第一天,老板把我叫到他办公室,坐下来慢慢喝茶,吹牛,给我吹他们以前做的软件,经营的产品,还装作一副什么都告诉我的样子,其实这都是套路,我早已 ...
- Go学习笔记(一)Let's 干
加 Golang学习 QQ群共同学习进步成家立业 ^-^ 群号:96933959 简介 Go是Google开发的一种 静态强类型.编译型,并发型,并具有垃圾回收功能的编程语言.为了方便搜索和识 ...
- C实现dos图文菜单程序实例
前言 公司一台服务器是novell环境,文件管理是基于dos6.22的,客户端启动需要一个图文菜单. 实现 编程环境:汉化版TC2.0 菜单基本功能:显示提示项.显示dbf中的行情信息. ...
- str-字符串功能介绍
叨逼叨:字符串的各个功能修改不是本身,本身不变,会产生新的值,需要赋值给新的变量来接收 以下 "举例" 是解释每个功能的实例 "举例"下一行是pycharm ...
- java的字符串操作和for循环的使用
/* "12 0 99 -7 30 4 100 13" 要求对字符串中的数值进行排序.生成一个数值从小到大新字符串. "-7 0 4 12 13 30 99 100&qu ...
- raft如何实现leadership transfer
leadership transfer可以把raft group中的leader身份转给其中一个follower.这个功能可以用来做负载均衡,比如可以把leader放在性能更好的机器或者离客户端更近的 ...
- Educational Codeforces Round 25 Five-In-a-Row(DFS)
题目网址:http://codeforces.com/contest/825/problem/B 题目: Alice and Bob play 5-in-a-row game. They have ...
- 【原创】EntityFramework Core 中使用 CodeFirst 模式时 PowerShell 版本问题及解决
一.描述: 在使用 Entity Framework Core 时,使用 CodeFirst 模式, 在 VS 中的 PMC(nuget 包管理 控制台) 控制台界面使用如下命令: Install-P ...
- Hadoop 2.6.5 FileSystem和Configuration两个对象的探究
Hadoop 2.6.5 FileSystem和Configuration两个对象的探究 版权声明:本文为yunshuxueyuan原创文章,如需转载,请标明出处.[http://www.cnblog ...
- python之基本内容
这里提供在使用python进行开发中常使用到的方法技巧,如有不对欢迎批评指正. 要点:开发中类.变量特性查询,类型就是类,断言的使用,深浅复制判断等 python脚本文件是使用UTF-8编码的,所以在 ...