访问提供此请求所需的资源时发生错误.

wor*_*ssm 3 asp.net iis

我想在localhost中设置一个asp.net网站.Fitst,我启用了IIS服务器并在C:\ inetpub\wwwroot文件夹中创建了网站并运行以确保正确设置IIS.在这种情况下,我使用了我从visualstudio IDE创建的现有网站.一切都很完美.在这种情况下,我大量使用以下文章. http://forums.asp.net/t/1689133.aspx

现在问题是我有一个从远程服务器下载的网站,我想在localhost中托管它.当我比较我下载的网站和工作网站时,我发现有些文件丢失了.但是,远程服务器上的站点工作正常.

我没有看到bin文件夹,并且web.config文件中没有太多信息.

这是web.config文件中的代码

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".json" mimeType="application/json" />
        </staticContent>
    </system.webServer>
    <system.web>
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
</configuration>
Run Code Online (Sandbox Code Playgroud)

当我尝试执行上一个网站所做的相同过程并尝试浏览器然后我得到关注错误.

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL. 

Error message 401.2.: Unauthorized: Logon failed due to server configuration.  Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server.  Contact the Web server's administrator for additional assistance.
Run Code Online (Sandbox Code Playgroud)

错误在哪里?如何解决这个问题?如果您想了解更多信息,请告诉我们?

Gui*_*OND 9

我建议你首先允许WebConfig中的所有用户

<system.web>
    <authorization>    
        <allow users="*" />
    </authorization>    
</system.web>
Run Code Online (Sandbox Code Playgroud)

编辑:正如David Thompson所提到的,这是非常不安全的.仅用于取消阻止测试示例代码方案.请不要生产.