康骄建材信息网

ad2

WCF Samples 运行出错的解决办法 - 系统综合

时间:2009-06-21 05:22来源: 作者:CPU问题答疑-电脑爱好者  点击:
最近刚开始学习WCF,从ms网站下了WCF Samples研究... 安装完了开始运行第一个demo,TechnologySamples\Basic\GettingStarted\CS\GettingStarted.sln,Sample由于是2005的,升级solution到2008,没问题,rebuild了一下OK,后来发现client和service项目的Target Framework
最近刚开始学习WCF,从ms网站下了WCF Samples研究...
安装完了开始运行第一个demo,TechnologySamples\Basic\GettingStarted\CS\GettingStarted.sln,Sample由于是2005的,升级solution到2008,没问题,rebuild了一下OK,后来发现client和service项目的Target Framework都是2.0,奇怪怎么还能编译通过?困惑中...
先不管了,先跑起来看看吧,一运行client就报异常,OMG...
The requested service, 'http://localhost/servicemodelsamples/service.svc' could not be activated. See the server's diagnostic trace logs for more information. Rebuild的时候已经发现service被部署到C:\Inetpub\wwwroot\servicemodelsamples下面了,单独访问了一下'http://localhost/servicemodelsamples/service.svc'就报了黄页晕,
Stack Trace:
[InvalidOperationException: The type 'Microsoft.ServiceModel.Samples.CalculatorService', provided as the Service attribute value
in the ServiceHost directive could not be found.]
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +4189701
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +516
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +31
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +498
[ServiceActivationException: The service '/servicemodelsamples/service.svc' cannot be activated due to an exception during compilation.
The exception message is: The type 'Microsoft.ServiceModel.Samples.CalculatorService', provided as the Service attribute value
in the ServiceHost directive could not be found..]
System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +183
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +205
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +322
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

搞不懂ms给的sample都跑不了,于是只能求助google,在msdn forums上找到了答案
Running: ...\TechnologySamples\Setup\CS\cleanupvroot.bat and then:...\TechnologySamples\Setup\CS\setupvroot.bat
一切OK,ms真会跟我们开玩笑呵呵...(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
推荐内容
热点内容
Copyright 康骄建材信息网(www.hker.net). All Rights Reserved. 渝ICP备19017680号
Powered by Hker6.0 建议1024*768.本站文字来源网络,如有侵权请联系我们删除:Hkeradmin@gmail.com。