IIS 7.5 - 403 Forbidden - asp.net

Ok, I have scoured online resources and applied all the suggested solutions.
I am setting up a simple website on Windows Server 2008 R2 under IIS 7.5 using the "ASP.NET v4.0" pool. I am setting this up as an application under Default Web Site with a different root. I keep getting the 403 Forbidden error.
I have:
Installed asp.net using aspnet_regiis.exe -i (many times)
Made sure my root directory (physical path) has permissions for
"IIS_IUSR" and "IUSR" users.
Made sure "Anonymous Authentication" is enabled and set to "Application Pool Identity"
I have restarted IIS numerous times
I have checked and double-checked every other configuration.
What's strange is that I have another application under Default Web Site and it works just fine.
Any suggestions will help. This shouldn't be so hard unless I am missing something obvious.

Ok, I am quite embarrassed but the over sight was that "Require SSL" was checked by default and that is the place I did not check. I guess it is because an SSL is bound to the Default Web Site. Removing that check made it work.
Hopefully this will help someone else.

Haha you think that is embarrasing! This is probably the 1000th webserver I've installed... 30mins of 403s!! I can't figure it out. There is a stub default.asp in there.. permissions all correct... everything!
I turned on "directory" browsing in desparation of flicking around.
default.asp.txt is sitting there..... DOH.
Need to turn OFF "known file types"... why is that setting like that anyway?

Another possible issue which leads to a 403 error:
The Global.asax file is missing.

For me the answer was in handler mappings section of IIS 7.5
Adding the following to web.config enabled all the aspx pages to work correctly
<configuration>
...
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<handlers accessPolicy="Read, Script" />
...
</system.webServer>
</configuration>

Grant permission to the Network Service user in the NTFS folder
Also check the .Net authorization rules:

Check that IP address restrictions are not blocking the request. Can check this in the logs.
(This was my embarrassing reason!)

Mine was even more embarrassing.
Right Click on folder,Remove READ only attribute.

For me, there was a vestigial Web.config in C:\inetpub\wwwroot with rewrite rules. Deleting it solved the problem.

I was facing issue on windows 7 and surprisingly it was fixed after installing service pack 1

You might also get this if setting up FTP for a website and you try and change the default directory for FTP on the website.
From what I can tell:
Manage FTP Site -> Advanced Settings -> Physical Path
is the same
Manage Website -> Advanced Settings -> Physical Path
Changing one will change the other and possibly cause a 403 on a working site.

Related

Hosting ASP.NET in IIS7 gives Access is denied?

I have setup a application in my IIS7 that uses .NET Framework 4.0 (runned by NetworkService) but when browsing the site I get this:
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*
I have tried to give NetworkService full permission on the folder that holds the website (the one that the web application in IIS is pointing against) but I do still get the access denied?
Why?
I gave access to "IIS_IUser" but instead it should be "IUSR". That solved the problem.
For me, nothing worked except the following, which solved the problem: open IIS, select the site, open Authentication (in the IIS section), right click Anonymous Authentication and select Edit, select Application Pool Identity.
I had the same problem, I enabled "Anonymous Authentication" but it still did not work.
So I also ENABLED "Forms Authentication" Then it worked without any problems.
OS : Windows 7 & IIS 7
If you still have permission denied after adding IUSR & NETWORK SERVICE.
Add also IIS_WPG. The addition of this last user solved my problem.
For people who can't find those users:
when you're trying to add a user in security of the folder (properties of the folder), click on "Advanced" of the window "Select Users or Groups". Change the location to the computer name then click on "Find Now". You'll find those users in the list below.
If you're using Anonymous Authentication, IIS 7 will use the "IUSR" account for directory access (unless you've set it to use the app pool identity. If you haven't granted IUSR sufficient permissions on your site's folders and files, you'll get this error
For me in windows 7 it started to work only after I gave 'Read & execute', 'List folder contents', 'Read' permissions to site folder for both users
IUSR
NETWORK SERVICE
Tried most of the solutions here, but no luck. What worked for me was adding "Everyone" to the security permissions. Properties -> Security -> Edit -> Add -> Everyone. The given defaults were enough for me to regain access.
In the near future, I should probably figure out what credentials are being sent to the server so that I can give proper permissions. But I hope it helps someone!
In the Authentication settings for APP itself (IN IIS), see if you have anonymous enabled.
We need to create a new user ComputerName\IUSR by going to the website folder-->Properties--->Security--->Edit-->Add and give read access. This would work definitely.
This solution is for IIS7
I went round and round on this and it turned out to be improperly set default page. Hope this helps someone else avoid an hour of wasted time.
In my case running c:\windows\Microsoft.Net\Framework64\v4.0.30319\aspnet_regiis.exe /i resolved the 403 access denied issue.
Checking the Application Pool Identity in Anonymous Authentication and enabling Forms Authentication would solve problem for access denied error. 😁
After some thinking and a lot of of trial and error I found out that this error occurred because part of my web.config was encrypted and for some reason the key was no longer valid.
Re-encrypting the config section solved the issue.
After watching this tutorial :
https://www.youtube.com/watch?v=RbrZbHpXBTE&list=PLp1Emx1rT4z9YWLDXBjUwBb130qv2Zq2x&index=4&ab_channel=LearningProgrammingTutorial
I had the same problem using RDP ( windows server 2016 Datacenter )
i followed the tutorial above & enbaled my directory browsing options from the IIS internet infromation services manager.
what you want to do is to access your IIS manager , you can check out the tutorial above to learn how to access IIS manager if you have trouble acessing there , it was useful for me that's why I'm sharing then ... go to :
you should gave access to IUSER
( or application tool identity , depends or what you want to work with )
and your problem would be solved! :)
Also you need to check your firewall and TCP settings , if ping between two machines didn't work for you , you can check this out :
https://operavps.com/rdp-connection-issues/
It was due to WWWRoot directory security issue.
Simple solution is, Just copy applicatio folder to some other drive, Instead of "C:\Inetpub\wwwroot"
and then create a virtual directory for this new path. That's it.
If the IUSR user is already specified in Authentication and you're still getting this issue, it could be that your Directory Listing isn't enabled. Be sure to check that. That was the case for me.
This is what happened to me:
Get - Post is ok. Working well.
When I try to use Options verb, the server return error like that.
Then, beware with urlScan
I add OPTIONS verb to urlscan configuration .ini file, then everything works well.
To check if urlscan is installed or not, open your iis manager, and open ISAPI FILTERS url scan should appear at the list.
I was also facing the same issue,
Everything was normal all the rights were given to the user and for folder as well.
After many research i found that the wwwroot (Source code folder) was shared with some other user.
I stopped sharing and it worked like a charm.
I was facing this issue after pulling from remote master and adding to the appsettings on web.config.
I solved it by enabling Windows Authentication:
Click on the project and press f4
Make sure Windows Auth is enabled:

IIS 7.5 and Razor Site: 500 errors for CSS and JS

For some reason, when I deploy my Razor MVC web site to my Windows 2008 R2 server, I'm getting 500 internal server errors for all CSS and JS. I'm not sure why, because I've done the following:
Enabled static content in IIS
Enabled anonymous access, with the default ID being the application pool identity and given that identity read/write permission to the folders
Ensured my static content handler was setup correctly
What other problems could it be? How can I even debug this to see what the actual error is? Even though I have an Application_Error handler, nothing is getting logged. And IIS logs doesn't give me the error info?
Thanks.
Mime-Types were my trouble
I had the same problem. My css and js was not delivered. Server says internal error.
I found out that i added the mimetype for mp4 in the global settings of the iis and also added the mime type in one of my websites as well.
That was a problem. This mime-type can only exist in the website or global, not both.
I deleted tehe global mimetype and everything worked like it should be.
Hope to help some guys of you.
Just found, that I've added to web.config *.woff MIME for IIS 7.5, so when deploying on IIS8, it's causes static files error. After removing that from web.config everything is fine.
I got 500 errors because I added this below to my web.config. After I removed it, I got passed the error.
<staticContent>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
To rule out one basic permissions situation, try this:
Select your web site and go into Basic Settings.
Take note of which application pool your site is running under.
Exit out of there and select the Application Pools node.
Find the application pool for your site, and take note of which identity (account) that application pool is running under.
If the account is a specific user identity -- in other words, if it's not a built-in account (such as ApplicationPoolIdentity, Network Service, Local System, etc) then:
Launch your Local Users and Groups.
Find and open the local IIS_IUSRS group.
If the account in question is not a member of the group, add it.
Reinstalling IIS fixed the problem.
If you are on your local server and taking this error, please check if you have any missing packages. Catch errors in global.asax and if neccessary reload all packages with;
Update-Package -reinstall
in Package manager console.
Hope it helps.

Cannot read configuration file due to insufficient permissions

I've recently encountered an error trying to host my asp.net site with IIS. I have found a solution that many swear by.
Solution:
Add IIS_IUSRS with Read permission on files in the folder
Change IIS authentication method to BasicAuthentication
refresh the website. It will work
(http://vivekthangaswamy.blogspot.com/2009/07/aspnet-website-cannot-read.html)
What do I add to my web.config file though? I've never had to edit it before. Here is its current contents:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
</system.web>
</configuration>
My error is:
Config Error: Cannot read configuration file due to insufficient permissions
Config File: \?\C:\Users*****\Documents\Visual Studio2010\WebSites\PointsForTime\web.config
There is no problem with your web.config. Your web site runs under a process. In iis you can define the identity of that process. The identity that your web site's application pool runs as (Network Services, Local System, etc.), should have permission to access and read web.config file.
Update:
This updated answer is same as above, but a little longer and simpler and improved.
First of all: you don't have to change anything in your config file. It's OK. The problem is with windows file permissions.
This problems occurs because your application can not access and read web.config file.
Make the file accessible to IIS_IUSRS group. Just right click web.config and click properties, under security tab, add IIS_IUSRS.
So what is this IIS_IUSRS thing?
Your web site is like an exe file. Just like any exe file, it should be started by a user and it runs according to permissions assigned to that user.
When your site is started in IIS, Application Pool of your web site is associated with a user (Network Services, Local System, Etc. ...) (and can be changed in IIS)
So when you say IIS_IUSRS, it means any user (Network Services, Local System, Etc. ...) that your site is running as.
And as #Seph mentioned in comment below: If your computer is on a domain, remember that IIS_IUSRS group is a local group.
Also make sure that when you're trying to find this user check the location it should be set to local computer and not a corporate domain.
I had what appeared to be the same permissions issue on the web.config file.
However, my problem was caused by IIS failing to load the config file because it contained URL rewrite rules and I hadn't installed the IIS URL rewrite module on the new server.
The solution was to install the rewrite module.
I had the same problem when I tried to share the site root folder with another user. Some folder lost the permission.
So I followed the steps to add permission to IIS_IUSRS group as suggested by Afshin Gh.
The problem is this group was not available for me. I am using windows 7.
What I did I just changed some steps:
Right click on the parent folder (who lost the permission),
Properties => Security =>In "Group or user names:",
Click Edit...
Window "Permission for your folder" will be opened.
In "Group or user names:" press ADD... btn,
Type Authen and press Check Names,
You will see the complete group name "Authenticated Users"
Press ok => apply.
This should enable privileges again.
That worked for me.
Editor's note: Doing what this answer suggests: "changing Identity to LocalSystem" is DANGEROUS! The LocalSystem account is a ...
Completely trusted account, more so than the administrator account. There is nothing on a single box that this account cannot do, and it has the right to access the network as the machine (this requires Active Directory and granting the machine account permissions to something)
Changing the Identity from ApplicationPoolIdentity to LocalSystem did the work ;).
I am using win7 64 with IIS 7.5
more about
Application Pool Identity in IIS 7.5 and win 7
Make the file accessible to the IIS_IUSRS group. Right click your web.config, expand properties, and under security tab, add IIS_IUSRS. Give the group read/write access.
When the group is NOT available, replace IIS_IUSRS by ComputerName\IIS_IUSRS
You don't have to change anything in your web.config.
The problem is file system permissions. Your file permissions do not allow the IIS_IUSRS user to access web.config (or probably any of the files). Change their file permissions in windows to allow the IIS_IUSRS account to access it.
When you grant permissions to IIS_IUSRS you should check that in the IIS/Authentication section of your Web Application, the Anonymous Authentication Credentials uses Application Pool Identity and not IUSR.
Go to the parent folder, right-click and select Properties. Select the Security tab, edit the permissions and Add. Click on Advanced and the Find Now. Select IIS_IUSRS and click OK and OK again. Make sure you have check Write. Click OK and OK again.
Job done!
For some reason your web.config is set as read only. Uncheck the readonly option of web.config file.
I needed to add permissions to IUSR (in addition to ISS-IUSRS, as others have suggested).
(See also:
http://codeasp.net/blogs/raghav_khunger/microsoft-net/2099/iis-7-5-windows-7-http-error-401-3-unauthorized)
Instead of giving access to all IIS users like IIS_IUSRS you can also give access only to the Application Pool Identity using the site. This is the recommended approach by Microsoft and more information can be found here:
https://support.microsoft.com/en-za/help/4466942/understanding-identities-in-iis
https://learn.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities
Fix:
Start by looking at Config File parameter above to determine the location that needs access. The entire publish folder in this case needs access. Right click on the folder and select properties and then the Security tab.
Click on Edit... and then Add....
Now look at Internet Information Services (IIS) Manager and Application Pools:
In my case my site runs under LocalTest Application Pool and then I enter the name IIS AppPool\LocalTest
Press Check Names and the user should be found.
Give the user the needed access (Default: Read & Execute, List folder contents and Read) and everything should work.
I used subst to create a mapping from D: to C: in order to keep the same setup as other developers in the team. This also gave me same errors as described. Removing this fixed it for me.
This happened to us when the IIS application has a Virtual Directory with a Physical Path that contains forward-slashes / instead of backslashes \. This was accidentally done using a powershell management API for IIS during our continuous delivery process.
Bad Config Example - applicationHost.config
<application path="/MySite/MyService" applicationPool="MyAppPool" enabledProtocols="http">
<virtualDirectory path="/" physicalPath="C:\inetpub\MySite/MyService" />
</application>
Make sure the physicalPath attribute does not contain forward-slashes /, only backslashes \
Corrected Config Example - applicationHost.config
<application path="/MySite/MyService" applicationPool="MyAppPool" enabledProtocols="http">
<virtualDirectory path="/" physicalPath="C:\inetpub\MySite\MyService" />
</application>
Changing the Process Model Identity to LocalSystem fixed this issue for me. You can find this setting if you right click on the application pool and chose "Advanced Settings". I'm running IIS 7.5.
Shift your project to some drive other than C:
Worked for me with the same error.
The accepted solution didn't for me. I use a Git repo and it cloned to the following folder
c:\users\myusername\source\repos\myWebSite
I made new IIS website and pointed it at the path. Which didn't have the iis_iusrs permissions suggested in the accepted solution. When I added the permissions it still didn't work.
It only started working when I gave the following permissions to the 'Users' group and inheritance cascaded the permissions to web.config. Probably should have applied it just to the web.config to reduce attack surface area.
All answers given are valid and working under different circumstances.
For me, restarting Visual Studio worked.
We had a website running with a specific identity in the apppool, only after giving that user read access to the folder containing the web.config would it work.
We tracked this down after adding the 'everyone' user with read and everything worked fine.
For me the error turned up during Debugging on my local machine and turned out to be related to the base web.config, which is initiated by the .NET Framework when compiling the website. My C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config file had an unrecognized element (folderLevelBuildProviders). Fixing this fixed the 500.19 error.
See this: IIS Manager can't configure .NET Compilation on .NET 4 Applications
Right click Web.Config => Tab Security => Button Edit => Button Add => Button Advanced => Button Find Now = > In Search results select your group(in our case " IIS_IUSRS") => Ok => Ok=> Ok
I have solved this by adding read permission to folder for application pool user (WIN SERVER 2008 R2):
C:\Windows\System32\inetsrv\config
A little background:
Our server has been hacked using classical error where app user had more permissions that it should (local admin).
To fix it we created new domain user that had only permissions on application folder, with min needed rights and assigned it as application pool user. than we hit in the issue and this was solution to our problems.
This can happen if your application is in a virtual directory and the path to the files is a mapped drive.
If you change the path to the files to a local drive, this will solve it, if that indeed is your problem.
The above answers were helpful, but in case this helps anyone - I had this exact problem, and it turned out that I was (windows networking) sharing the root folder that the site was being hosted from. We killed the share, and added the Users permission to read/execute and it worked again just fine.
I suspect the share messed it up.
I was receiving the "Cannot read configuration file due to insufficient permissions" as well. Turns out the ISAPI and CGI Restrictions in IIS for both ASP.NET 4.0 32bit and 64bit was set to deny. Marking them both to Allowed fixed my problem.
Had this issue with a Virtual Application. All the permissions were set.
IIS_IUSRS, AppPoolIdentity and then gave full access to Everyone. Nothing worked. Restarted apppool, site and IIS but No go.
Deleted the virtual application and added it again from scratch and it started working.
Wish I knew what solved it.
check if the file is not marked as read-only, despite of the IIS_IUSRS permission it will display the same message.
I had this error message that turned out to be due to my physical folder being located on a network drive as opposed to the local drive. It seems the permissions on such drives by default can be different. For example, while the local drive location gave permission to the users of the local computer, the network location did not.
Further, the accepted answer does not work for such a case. The local users or IIS users were not an available to assign permissions to. The solution was to move the physical folder to the local drive.
I had the same issue and after doing all the stuff written here as answers, it still reproduced.
The second half of the issue was the fact that .NET was turned off under "Turn Windows features on or off"
Sometimes if it is a new server you need to configure or install ASP.NET feature on IIS for it to be able to read your web.config file.
In my case this was the reason.
In my case, I was trying to host pages from a mapped drive (subst).
The issue is that the subst was run under my account and the IIS user is not able to see the same drive

Cannot log on locally IIS [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
What causes this error, how can I fix it?
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x8007052e
Config Error Can not log on locally to C:\inetpub\wwwroot as user administrator with virtual directory password
Config File Unavailable (Config Isolation)
Requested URL http://192.168.0.3:80/
Physical Path C:\inetpub\wwwroot
Logon Method Not yet determined
Logon User Not yet determined
Config Source
<application path="/" applicationPool="PS-Extranet">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" userName="administrator" password="[enc:AesProvider:PrISRz2ggJH4bV46ktObfCSh91Y/yF9pAoLmH7eCnj0=:enc]" />
</application>
I had the same issue, but reason was different.
In my web.config there was a URL rewrite module rule and I haven’t installed URL rewrite module also. After I install url rewrite module this problem solved.
Looks like the user account you're using for your app pool doesn't have rights to the web site directory, so it can't read config from there. Check the app pool and see what user it is configured to run as. Check the directory and see if that user has appropriate rights to it. While you're at it, check the event log and see if IIS logged any more detailed diagnostic information there.
On Windows 10 I had to install ASP.NET 3.5 and ASP.NET 4.6 under Internet Information Services (the other boxes automatically check themselves):
Finally I get the solution for my problem. The asp.net account not appear in the IIS manager because I didn't check its check Box in IIS to do this in windows 7 follow the steps
Open control panel
Click on” program” link (not uninstall programs)
Click” turn windows features on/off” link
locate” Internet Information services IIS” in the pop up window and expand its node
Expand the” World Wide Web Service” node
Expand “Application Development Features” node
check the check box of”ASP.NET”
Then click ok button
Now you will see the Asp.net account on the IIS manager and by default you see IIS account Now you should move you asp.net website from “my document” to another place the IIS have permission to access it (to any partition on your computer) Now browse your website from IIS manager and it should work.
We got this error after having to change our domain administrator password.
After monkeying with several settings, I eventually found that in the application in below path as it was set to specifically use the domain administrator account rather than pass-through authentication (who knows why).
IIS Manager -> Basic Settings -> Connect
you need to do one step:
run->cmd
run "c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i"
Thats it
Experienced this issue today and resolved it. Someone had set the "Path Credentials" for the "Default web site" in IIS to run as a specific user. This same user changed her password either due to the password expiring or just a routine change. Setting the "Default website" to connect as the "Application User" via the basic settings option resolved it for me
you probably change your NT password.
Open IIS -> Right click on your application -> manage application -> advanced Setting -> physical path credentials.
good luck
In my case, this error appears after changing folder's solution.
I solve the problem by goin to my project properties and recreate my virtual directory.
Right click on project > Properties > Web > Under Servers section click "Create Virtual Directory"
It will display a message saying that the virtual directory was created in another place and it will change it
For me, I needed to enable Http Activation under the .Net features in "Add/Remove Windows Features"
Got this working alright but not based on suggestions above. My case is that am getting the 500 error running iis7 on a windows 2008 server in a domain. Just added a new user in the domain and basically allow read/execute access to the virtual directory or folder. Ensure that the virtual folder>basic settings> Connect As > Path credentials is set to a user with read/xecute access. You can test settings and both authentication and authorization should work. Cheers!
Default web site need to manage as well:
1 .On Default web site -> basicSettings -> connect as, change it to the right user.
2.change the Identiy of the applicationPool that related to the defaultWebSite
g.luck
Right now i had this error and resolved it. Your url could match with created virtual directory.
You have to check virtual directories, in my example i found in applicationhost.config next row:
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/admin/roles" physicalPath="C:\..." />
</application>
I tried to open page with an url (http://localhost/admin/roles) of AdminController and Roles action and got this error.
For others out there, I got a similar error message due to trying to run a .Net 4 app in a .Net 2 app pool. Changing the .Net FX version for the app pool fixed it for me.
I was having a similar error installing php 5.3.3 with the Error Code 0x80070020 with a direction to a few lines in web.config in my www root directory (not the standard root directory).
The solution, while crude, worked perfectly. I simply deleted the web.config file and now everything works. I spent HOURS trying other solutions to no avail.
If anyone thinks this was stupid, please let me know. If anyone else has spent the same amount of time pulling out hair, try it and see (after backing up the file of course)
Regards FEQ
Was having the same error and fixing the credentials in the IIS app pool did not help. I finally resolved the error in IIS by selecting my website under Default Web Site, Advanced Settings->Physical Path Credentials->Specific User, and reentered the credentials for the app pool user, then restarted IIS and the error went away and my website came up successfully.
As I got the 500.19, I gave IIS_IUSRS full access rights for the mentioned web.config and for the folder of the project. This solved the issue.
You can give permissions by
right click on the folder / file
selecting the tab "security"
add the user IIS_IUSRS - don't forget the i in front of USRS and don't write an "e" as in USERS
If it's bigin when you try to acces to joomla administrator panel, Just a username and password problem !! You have just to update a jos_user in your joomla database.
Go to your joomla web site directory and open a configuration.php with bloc note or note pad to show what database name your joomla administrator site use.
You have to find a line who have:
public $user = 'joomlauser251'; //MySQL username
In my case joomlauser251 is my DB name.
Login to your mysql:
mysql -uyourusername -pyourpassword
Select database for your joomla:
use joomlauser251;
Change password for admin:
UPDATE jos_users SET password=MD5(‘NewPassword’) WHERE username=’admin’;
And retry to acces again.
That’s all !!!
Didn't seem to be a permission issue for me - tried giving the IIS_IUSRS account full control over everything in the web service, just to see if this was the cause. The fix turned out to be recreating the application hosting the web service (i.e. the actual '.svc') in IIS
In my case, I found a reference to an old domain account password in applicationHost.config under Virtual Directory defaults.
so easy
find the file "applicationHost.config" in Windows -> System32 ->inetsrv -> config
1. backup "applicationHost.config" to another filename
2. open file "applicationHost.config" clear data and save
3. open browser and call url internal website , finished.
If you are using a new, dedicated, user account... It is also worth checking that the password for that account has not expired, as that will also cause this 500.19 permissions issue.
For ASP.NET Core websites, this generic error will also occur if you don't have the HttpPlatformHandler module installed, see this answer for more details.
ASP.Net applications come pre-wired with a handlers section in the web.config. By default, this is set to readonly within feature delegation within IIS. Take a look in IIS Manager
1.Go to IIS Manager and click Server Name
2.Go to the section Management and click Feature Delegation.
3.Select the Handler Mappings which is supposed to set as readonly.
4.Change the value to read/write and now you can get resolved the issue
I have just one more thing to say about this. With the same HTTP Error code, you can still have several different errors, as one of them has been posted here at the original question's description.
For example: after I've edited the Web.Config file of an ASP.NET project, I had
Error Code 0x8007000d
"Only one <configSections> element allowed. It must be the first child element of the root <configuration> element "
As it says, you must NOT insert your own XML stuff before the <configSections> part of the Web.Config file. After I've inserted my snippet after the end tag of <configSections>, it worked just fine.
My website's correct path was not specified in IIS.
My solution is that,
just delete the corrupted folder.
Then re-create folder again.
It seem that if the corrupted folder had been created before IIS
setup. If you created folder again, it will work correctly.
I got this error after uninstalling Windows Server Update Services (WSUS) from the computer running IIS. Apparently uninstalling WSUS may break the IIS configuration on the server making other web application installed on the same server unavailable.
I found the solution for the problem here.
In my case, the value of the Key was incorrect in Web.config file:
<defaultDocument>
<files>
<add value="Portal.htm" />
</files>
</defaultDocument>
when I change the value to "Portal.html" it worked.
I got this error after upgrading from Visual Studio 2013 to 2015. After a bit of searching and trying various fixes I found the problem can be resolved by removing the following from web.config:
<staticContent>
<mimeMap fileExtension=".less" mimeType="text/css" />
</staticContent >
Apparently staticContent is deprecated now?
Source
Edit 1
This sort of prevented IIS from serving .json files when the program was deployed. If you do this you're supposed to re-add .json (application/json) to the mime types of your site in IIS. Here is some more info: http://www.iis.net/configreference/system.webserver/staticcontent/mimemap
Edit 2
I noticed that in my situation the above edit 1 solution only works temporarily. Once I redeploy the entry gets removed. So, I moved the mimeMap XML into Web.Release.config. Works fine now.

ASP.NET 2.0 - How to use app_offline.htm

I've read about the app_offline.htm file which can be placed within the root of a .NET 2.0 application which will in essence shut down the application and disable any other pages from being requested.
I've placed the file in the root, and my site still loads. I went into default documents in IIS and set it to app_offline.htm and the site still loads (this might have been a caching issue though)
Anyway, has anyone run into issues using this? Am I doing something wrong?
I have used the extremely handy app_offline.htm trick to shut down/update sites in the past without any issues.
Be sure that you are actually placing the "app_offline.htm" file in the "root" of the website that you have configured within IIS.
Also ensure that the file is named exactly as it should be: app_offline.htm
Other than that, there should be no other changes to IIS that you should need to make since the processing of this file (with this specific name) is handled by the ASP.NET runtime rather than IIS itself (for IIS v6).
Be aware, however, that although placing this file in the root of your site will force the application to "shut down" and display the content of the "app_offline.htm" file itself, any existing requests will still get the real website served up to them. Only new requests will get the app_offline.htm content.
If you're still having issues, try the following links for further info:
Scott Gu's App_Offline.htm
App_Offline.htm and working around the "IE Friendly Errors" feature
Will app_offline.htm stop current requests or just new requests?
Make sure your app_offline.htm file is at least 512 bytes long. A zero-byte app_offline.htm will have no effect.
UPDATE: Newer versions of ASP.NET/IIS may behave better than when I first wrote this.
UPDATE 2: If you are using ASP.NET MVC, add the following to web.config:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
Note that this behaves the same on IIS 6 and 7.x, and .NET 2, 3, and 4.x.
Also note that when app_offline.htm is present, IIS will return this http status code:
HTTP/1.1 503 Service Unavailable
This is all by design. This allows your load balancer (or whatever) to see that the server is off line.
Possible Permission Issue
I know this post is fairly old, but I ran into a similar issue and my file was spelled correctly.
I originally created the app_offline.htm file in another location and then moved it to the root of my application. Because of my setup I then had a permissions issue.
The website acted as if it was not there. Creating the file within the root directory instead of moving it, fixed my problem. (Or you could just fix the permission in properties->security)
Hope it helps someone.
Make sure that app_offline.htm is in the root of the virtual directory or website in IIS.
Make sure filename extensions are visible in explorer and filename is actually
app_offline.htm
not
app_offline.htm.htm
I ran into an issue very similar to the original question that took me a little while to resolve.
Just incase anyone else is working on an MVC application and finds their way into this thread, make sure that you have a wildcard mapping to the appropriate .Net aspnet_isapi.dll defined. As soon as I did this, my app_offline.htm started behaving as expected.
IIS 6 Configuration Steps
On IIS Application Properties, select virtual Directory tab.
Under Application Settings, click the Configuration button.
Under Wildcard application maps, click the Insert button.
Enter C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll, click OK.

Resources