本文介绍了无法加载资源:服务器回应的401 /App/AngularJS/angular.min.js状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下错误:

Failed to load resource: the server responded with a status of 401 (Unauthorized) http://localhost/App/AngularJS/angular.min.js

该项目工程在本地主机上的罚款。但是,当我在IIS上运行(7.5)我得到上述的异常。

The project works fine on localhost. But when I run it on IIS (7.5) I get the above exception.

[图片]

[Image]

我的项目是.NET 4.5的项目(Web.API 2.2),我使用的UI AngularJS在这个项目中。

My project is .net 4.5 project (Web.API 2.2), I am using AngularJS for UI in this project.

我试图运行ASPNET_REGIIS - 我作为这个地方被接纳为解决方案。但是,这并不在我的情况下工作。我不知道是否有执行上的IIS [AngularJS] .js文件的Web.API项目所需要的任何东西?

I have tried running "aspnet_regiis - i" as somewhere this was accepted as solution. But it didn't work in my case. I don't know is there any thing required to execute [AngularJS].js files on IIS for Web.API project?

编辑:

我已经作出如下修改web.config文件:

I have made following changes to web.config file:

<location path="AngularJS">
<system.web>
  <authorization>
    <allow users="*" />
  </authorization>
</system.web>
</location>
<system.web>
  <authorization>
    <allow users="*" />
  </authorization>
  <compilation debug="true" targetFramework="4.5" />
 <httpRuntime targetFramework="4.5" />
</system.web>

此外,我已经设置了读/写/修改权限为IUSR&放大器;整个项目的IIS_ISURS的用户。

Also I have set the read/write/modify access for "IUSR" & "IIS_ISURS" users of whole project.

但我仍然可以在IIS上相同的异常。但同样运行良好与VS2013。

But still I get the same exception on IIS. But same running fine with VS2013.

错误:

Error:

推荐答案

在服务器的访问被拒绝的消息(401未授权访问)响应,这意味着匿名IIS用户帐户无法访问,因为权限问题的资源。

When servers respond with access denied message (401 Unauthorized access), it means that the anonymous IIS user account is unable to access the resources because of permission issues.

在默认情况下,IUSR帐户用于匿名用户。

By default, IUSR account is used for anonymous user.

所有你需要做的是:

IIS - >结果
认证 - >
设置匿名身份验证应用程序池标识。

IIS ->
Authentication -->Set Anonymous Authentication to Application Pool Identity.

问题解决了:)

这篇关于无法加载资源:服务器回应的401 /App/AngularJS/angular.min.js状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 15:51