I am having the following error:
Failed to load resource: the server responded with a status of 401 (Unauthorized) http://localhost/App/AngularJS/angular.min.js
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.
By default, IUSR account is used for anonymous user.
All you need to do is:
IIS ->
Authentication -->
Set Anonymous Authentication to Application Pool Identity.
Problem solved :)
Assuming that you are using form authentication and you are trying to get it before login. You can use the following in your web.config file inside <configuration>
.
<location path="AngularJS">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
It will make you files inside AngularJS
folder available without login
Well,
It's strange but It worked. The solution was to set the default user for "Connect as" in IIS. See the image given below.
I specified the administrator user & this started to work in IIS. I think this is some kind of requirement with AngularJS to work on IIS.
Thanks for replies.
It will work when you add IUSR into the application folder security.
Also I have set the read/write/modify access for "IUSR" & "IIS_IUSR" users of whole project.
this was enough for me to get around the same issue.
PS. sorry for using your image, just want to emphasize the step you mentioned that worked for me.