由于访问控制列表错误,IIS上的WCF和访问被拒绝

时间:2012-12-09 19:12:05

标签: .net wcf iis-7 ado.net

我正在编写使用IIS上托管的WCF服务应用程序的简单应用程序。一切都在VS12中工作所以现在我想把WCF放在IIS服务器上。我将所有svc,svc.cs和web.config文件复制到WCFHost文件夹,并在WCFHost / bin / I中复制调试器创建的文件。我配置了IIS,当尝试在chrome中运行主机时,它给了我错误:

Server Error in '/WCFHost' Application.

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. You might not have permission to view the requested resources. 

Error message 401.3: You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access to 'C:\Users\MiSiek\Documents\WcfNewsletter_2'.

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

在IIS上创建新应用程序时,我使用了我的用户并通过了。

我的web.config:

    <?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="NewsletterEntities" connectionString="metadata=res://*/NewsletterDAL_EF.csdl|res://*/NewsletterDAL_EF.ssdl|res://*/NewsletterDAL_EF.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=(local)\SQLEXPRESS;Initial Catalog=Newsletter;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>

  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="WCFHost.MessageService">
        <endpoint address="" binding="basicHttpBinding" contract="WCFHost.IMessageService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/WcfServiceLibrary/MessageService/" />
          </baseAddresses>
        </host>
      </service>
      <service name="WCFHost.MailingListService">
        <endpoint address="" binding="basicHttpBinding" contract="WCFHost.IMailingListService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/WcfServiceLibrary/MailingListService/" />
          </baseAddresses>
        </host>
      </service>
      <service name="WCFHost.RecipientService">
        <endpoint address="" binding="basicHttpBinding" contract="WCFHost.IRecipientService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/WcfServiceLibrary/RecipientService/" />
          </baseAddresses>
        </host>
      </service>
      <service name="WCFHost.SenderService">
        <endpoint address="" binding="basicHttpBinding" contract="WCFHost.ISenderService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/WcfServiceLibrary/SenderService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

0 个答案:

没有答案