WCF Windows服务访问被拒绝

时间:2011-08-15 20:34:33

标签: wcf configuration windows-services access-denied

我不明白......我有一个WCF Windows服务,我无法再打电话了......我总是收到这个错误:

  

无法加载文件或程序集'Microsoft.VisualBasic,   Version = 8.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或   其中一个依赖。访问被拒绝

这些东西在几天前做了一些调整之前一直很好用。无论我做什么,现在我无法摆脱它。

服务配置文件是:

<system.serviceModel>
  <services>
    <service name="myService"
             behaviorConfiguration="TransfertServiceBehavior">
      <host>
        <baseAddresses>
          <add baseAddress="net.tcp://localhost:8097/MyService"/>
        </baseAddresses>
      </host>
      <endpoint address=""
                binding="netTcpBinding"
                bindingConfiguration="TransactionalBinding"
                contract="myContract" />
      <endpoint address="mex"
                binding="mexTcpBinding"
                contract="IMetadataExchange" />
    </service>
  </services>
  <bindings>
    <netTcpBinding>
      <binding name="TransactionalBinding" transactionFlow="true" transferMode="Streamed"
               maxReceivedMessageSize="1000000000">
         <readerQuotas maxDepth="10000" maxStringContentLength="1000000000"
                       maxArrayLength="1000000000" maxBytesPerRead="10000" 
                       maxNameTableCharCount="10000" />
         <security mode="Transport" />
      </binding>
    </netTcpBinding>
  </bindings>
  <behaviors>
    <serviceBehaviors>
      <behavior name="TransfertServiceBehavior">
        <serviceMetadata httpGetEnabled="False"/>
        <serviceDebug includeExceptionDetailInFaults="False"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

虽然客户端配置在此处:

<system.serviceModel>
  <bindings>
    <netTcpBinding>
      <binding name="NetTcpBinding_SI6ISupportTransfert" closeTimeout="00:01:00"
               openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
               transactionFlow="true" transferMode="Streamed" 
               transactionProtocol="OleTransactions"
               hostNameComparisonMode="StrongWildcard" listenBacklog="10"
               maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
               maxReceivedMessageSize="65536">
         <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                       maxBytesPerRead="4096" maxNameTableCharCount="16384" />
         <reliableSession ordered="true" inactivityTimeout="00:10:00"
                          enabled="false" />
         <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
         </security>
      </binding>
    </netTcpBinding>
  </bindings>
  <client>
     <endpoint address="net.tcp://localhost:8095/myService"
               binding="netTcpBinding" 
               bindingConfiguration="NetTcpBinding_SI6ISupportTransfert"
               contract="myContract" name="mySevice">
         <identity>
            <userPrincipalName value="user@myDomain" />
         </identity>
     </endpoint>
  </client>
</system.serviceModel>

有什么可能导致这种“拒绝访问”的例外???

1 个答案:

答案 0 :(得分:1)

加载其中一个.net framework dll时,错误为“拒绝访问”。

可能有几件事:

  • .net框架的那个版本已从服务器中删除
  • 作为服务器标识的用户无权访问框架dll的
  • 作为服务器标识的用户密码已过期。
  • 作为服务器标识的用户密码已更改。

尝试停止并启动服务以检查密码。

尝试重新安装该服务以检查.net框架版本。