现在的位置: 首页 > 综合 > 正文

.net framework 3.5 做的WCF程序 打上sp1补丁就报异常的解决办法

2013年03月05日 ⁄ 综合 ⁄ 共 6104字 ⁄ 字号 评论关闭

这个问题从08年年底,一直困惑我到09年上班,不过还好,上班的第一天就把他给搞定了,估计是在家多睡了几天,头脑稍微清醒了一点。嘿嘿  下面是问题的描述

问题描述:

我原来用.net 3.5 做了一个WCF程序,部署到服务器上(Windows2003)访问一切正常,我用的vs2008和Vista操作系统。

我在本机Vista下打上.net 3.5 sp1补丁后,访问也正常,但部署到服务器上,也打上.net 3.5补丁访问就出错,但是,我的源码没有改动,为什么打完sp1补丁就出错了呢??还是Sp1有专门针对Windows2003的??还是打sp1的时候要删除原来的.net 3.5 ?? 还是打完sp1 必须还得在服务器装一个VS2008 sp1 ??

以下是异常信息,貌似没有找到服务

“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 

堆栈跟踪:

[CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7594687
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275
   System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) +0
   System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) +142
   System.ServiceModel.ClientBase`1.Close() +38
   System.ServiceModel.ClientBase`1.System.IDisposable.Dispose() +4
   ITMS.WebUI.Login.GetDomainInfo() in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:344
   ITMS.WebUI.Login.IsExitDomian(String domain) in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:302
   ITMS.WebUI.Login.CheckUserAccount(String usergid, String password, String domain) in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:75
   ITMS.WebUI.Login.btnLogin_Click(Object sender, EventArgs e) in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:47
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 

--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3053; ASP.NET 版本:2.0.50727.3053

在网上查阅后无相关资料,所以来这里请求高人指点,希望能找到答案

  • Gavin Luo - 发布于 于 2009年1月20日 12:43:30

     

    我原来用.net 3.5 做了一个WCF程序,部署到服务器上(Windows2003)访问一切正常,我用的vs2008和Vista操作系统。

    我在本机Vista下打上.net 3.5 sp1补丁后,访问也正常,但部署到服务器上,也打上.net 3.5补丁访问就出错,但是,我的源码没有改动,为什么打完sp1补丁就出错了呢??以下是异常信息,貌似没有找到服务,“/”应用程序中的服务器错误。
    --------------------------------------------------------------------------------

    通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

    异常详细信息: System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。

    源错误:

    执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 

    堆栈跟踪:

    [CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。]
       System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7594687
       System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275
       System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) +0
       System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) +142
       System.ServiceModel.ClientBase`1.Close() +38
       System.ServiceModel.ClientBase`1.System.IDisposable.Dispose() +4
       ITMS.WebUI.Login.GetDomainInfo() in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:344
       ITMS.WebUI.Login.IsExitDomian(String domain) in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:302
       ITMS.WebUI.Login.CheckUserAccount(String usergid, String password, String domain) in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:75
       ITMS.WebUI.Login.btnLogin_Click(Object sender, EventArgs e) in F:/Woring/PowerTMS/UTStarCom/Source/ITMS-Web/ITMS.WebUI/Login.aspx.cs:47
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

     

    --------------------------------------------------------------------------------
    版本信息: Microsoft .NET Framework 版本:2.0.50727.3053; ASP.NET 版本:2.0.50727.3053

    在网上查阅后无相关资料,所以来这里请求高人指点,希望能找到答案

  • Gavin Luo - 发布于 于 2009年1月20日 15:41:13

     

    微软中文技术论坛怎么连一个回复都没有呢,我都发贴半天了.....版主在吗??

  • Jin Miao - MSFT - 发布于 于 2009年1月25日 12:05:25

    你在IIS上的其它的app有问题吗?

     

    SP1应该就一个,没有专门给win2003的。也不用卸掉.net 3.5,或装vs2008sp1. 你有没有装KB959209

     

    http://support.microsoft.com/default.aspx/kb/959209

     

    SP1下载网页上说:

    IMPORTANT: After installing the .NET Framework 3.5 SP1 package (either the bootstrapper or the full package) you should immediately install the update KB959209 to address a set of known application compatibility issues.

  • Gavin Luo - 发布于 22 小时 58 分钟以前
     非常感谢你能帮我看了这个问题,更新了补丁之后,这个问题依然存在,而且奇怪的是我下载了一个Winform程序0实现的WCF,运行起来就很好 ,我现在开始怀疑我的部署是否合法,我在IIS里面部署网站App,然后在网站下面新建虚拟目录来部署服务App,但这样部署,在没有更新3.5sp1的时候是可以运行的,但更新了3.5以后就不能用了。报上面的异常
  • 解决办法:
        锁定了半天,发现web应用程序的Web.config的WCF配置节点有问题。endpoint这个节点里面有个 <identity>
                        <userPrincipalName value="host/GavinLuo-PC" />
    </identity>
    修改为
    <identity>
                        <servicePrincipalName value="host/GavinLuo-PC" />
    </identity>
    msdn上说,servicePrincipalName   (WCF) 客户端通过此标识连接到终结点,则它在使用此终结点进行 SSPI 身份验证时将使用 SPN。
    userPrincipalName    (WCF) 客户端在使用终结点进行 SSPI 身份验证时将使用 UPN。
    估计打完补丁后认证的方式变了,所以这里就验证不通过了,希望能为大家解决难题
    如果还没有解决,那么还有一个方法,就是用Windows 2003 去编译发布程序,这样WCF  100%就可以可通信了,哈哈

    抱歉!评论已关闭.