2013-01-08 76 views
3

我已经用C#编写我的服务框架4.0。这是它返回一个值服务器由于内部错误无法处理该请求。在WCF错误

在Web.config就是这样一个简单的方法:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.web> 
    <machineKey validationKey="0E1F430D6FFFA91FBEDAEC1D2DDAAC2127EB055DBAFB78328C5BDE83249A94EA66400453B" decryptionKey="A13EACEAAABBECF2D06619924A8" validation="SHA1" decryption="AES" /> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <services> 
     <service name="DecryptCookie.Service1"> 
     <host> 
      <baseAddresses> 
      <add baseAddress = "http://localhost:8732/Design_Time_Addresses/WCFandEFService/ProductService/" /> 
      </baseAddresses> 
     </host> 
     <endpoint address="" binding="wsHttpBinding" contract="DecryptCookie.IService1"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract = "IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceMetadata httpGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

当我尝试使用该服务,我得到这样的错误:

Error: The server was unable to process the request due to an internal error. 
For more information about the error, either turn on 
IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from 
the configuration behavior) on the server in order to send the exception 
information back to the client, or turn on tracing as per the Microsoft .NET 
Framework 3.0 SDK documentation and inspect the server trace 
logs.System.Exception {System.ServiceModel.FaultException} 

我不确定问题是什么。

任何帮助,在此将是巨大的,并大加赞赏。

感谢

王子

回答

12

当我得到这些神秘的错误,我打开跟踪,并创建一个服务日志(.svcLog)。然后您可以使用服务跟踪查看器工具加载/读取该文件。这将为您提供有关错误的详细数据。请点击此链接上的说明 - http://msdn.microsoft.com/en-us/library/ms732023.aspx

+0

存储跟踪文件在哪里?我在哪里可以配置该位置? –

+1

@MikeCaron ...您在.config文件中设置位置。我认为你可以创建一个相对路径,所以当你的应用程序改变环境时你很棒。 –

0

这可能是案件当u从1个系统复制项目到另一个。 在这种情况下,你必须删除从web.config端点和u应该添加服务引用再次

我希望这将解决乌尔prob.strong文本

1

请检查代理文件。检查是否有你的业务/数据访问文件更新的任何事情,而不是更新的代理。这是由于代理错误。

0

你可以尝试添加诊断您的的web.config文件得到日志:

<system.diagnostics>  
      <sources>  
        <source name="System.ServiceModel"  
                switchValue="All"  
                propagateActivity="true">  
          <listeners>  
            <add name="traceListener"  
                type="System.Diagnostics.XmlWriterTraceListener"  
                initializeData= "D:\AppLogs\Traces.svclog" />  
          </listeners>  
        </source>  
      </sources>  
    </system.diagnostics> 
相关问题