Related
The following shows a section from the web.config file for an application we're running in IIS. I've included it as an image so as to include the green line under useKernelMode, and the error message shown when hovering over it.
(Note: As you can see, this also applies to UseAppPoolCredentials and extendedProtection. I just selected useKernelMode for this example)
The configuration here should be correct - it was set up by an admin who presumably knows what he is doing, and it does seem to work fine. There is also documentation for Windows Authentication which identifies useKernelMode as a valid attribute.
Why then is this marked as an invalid attribute? Different versions of IIS obviously support different elements and attributes in config files - could it be that Visual Studio somehow relates this config file to an older standard for web.confi files, in which the attribute was in fact not valid? If so, is there some way for me to specify that this particular config should be validated according to a specific version of IIS, e.g. IIS 7.5, 8.5, or 10?
After all, I would like any real mistakes in my web.config to be marked this way, but I'd like to avoid (presumably) false positives like this.
I'm afraid it has nothing to do with IIS version. IIS locked it up and set to read only.
As you can see, the section is only allowed by applicationhost.config level.
If you access this in visual studio, you will receive
If you want to fix this, plesae set applicationhost.config.
<section name="windowsAuthentication" overrideModeDefault="Deny" />
to
<section name="windowsAuthentication" overrideModeDefault="Allow" />
After that, VS still report invaild attribute but IIS express and IIS will allow these attributes in web.config
I've encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error:
Config Error: This configuration section cannot be used at this path.
This happens when the section is locked at a parent level. Locking is
either by default (overrideModeDefault="Deny"), or set explicitly by a
location tag with overrideMode="Deny" or the legacy
allowOverride="false".
More detail can be found here, in Scenario 7 matches my hex error code.
The solution given on the linked site above is to set Allow for overrideModeDefault in the section mentioned in my error, in the applicationHost.config file. In my case, under Security in system.webServer. But if I look at the applicationHost.config on my local computer, where the site is properly deployed already, that section is set to Deny.
If this solution is correct, how is my local instance running just fine with the same web.config? According to my applicationHost.config, that section should be locked, but it's not. I'd prefer to not change the applicationHost.config file, because there are many other sites running on that server. Is there another solution?
I had the same problem. Don't remember where I found it on the web, but here is what I did:
Click "Start button"
in the search box, enter "Turn windows features on or off"
in the features window, Click: "Internet Information Services"
Click: "World Wide Web Services"
Click: "Application Development Features"
Check (enable) the features. I checked all but CGI.
btw, I'm using Windows 7. Many comments over the years have certified this works all the way up to Windows 10 and Server 2019, as well.
You could also use the IIS Manager to edit those settings.
Care of this Learn IIS article:
Using the Feature Delegation from the root of IIS:
You can then control each of machine-level read/write permissions, which will otherwise give you the overrideMode="Deny" errors.
For Windows Server 2012 and IIS 8, the procedure is similar.
The Web Server (IIS) and Application Server should be installed, and you should also have the optional Web Server (IIS) Support under Application Server.
Browse to “C:\Windows\System32\inetsrv\config” (you will need administrator rights here)
Open applicationHost.config
Note: In IISExpress and Visual Studio 2015 the applicationHost.config is stored in $(solutionDir).vs\config\applicationhost.config
Find the section that showed up in the “config source” part of the error message page. For me this has typically been “modules” or “handlers”
Change the overrideModeDefault attribute to be Allow
So the whole line now looks like:
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
After saving the file, the page loaded up fine in my browser.
Warning:
Editing applicationHost.config on 64-bit Windows
You need to unlock handlers. This can be done using following cmd command:
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/handlers
Maybe another info for people that are getting this error on IIS 8, in my case was on Microsoft Server 2012 platform. I had spend couple of hours battling with other errors that bubbled up after executing appcmd. In the end I was able to fix it by removing Web Server Role and installing it again.
1. Open "Turn windows features on or off" by: WinKey+ R => "optionalfeatures" => OK
Enable those features under "Application Development Features"
Tested on Win 10 - But probably will work on other windows versions as well.
I ran these two commands from an elevated command prompt:
%windir%/system32/inetsrv/appcmd unlock config /section:anonymousAuthentication
%windir%/system32/inetsrv/appcmd unlock config /section:windowsAuthentication
As per my answer to this similar issue;
Try unlocking the relevant IIS configuration settings at server level, as follows:
Open IIS Manager
Select the server in the Connections pane
Open Configuration Editor in the main pane
In the Sections drop down, select the section to unlock, e.g. system.webServer > defaultPath
Click Unlock Attribute in the right pane
Repeat for any other settings which you need to unlock
Restart IIS (optional) - Select the server in the Conncetions pane, click Restart in the Actions pane
This Did the trick for me, for IIS 8 Windows server 2012 R2
Go to "Turn on Features"
Then go to all default setting , Next, Next, Next etc..
Then, select as shown below,
Then reset IIS (optional) but do it safer side.
This is an additional solution as its a generic problem everyone have different of problem and thus different solution. Cheers!
The best option is to Change Application Settings from the Custom Site Delegation
Open IIS and from the root select Feature Delegation and then select Application Settings and from the right sidebar select Read/Write
On Windows Server 2012 with IIS 8 I have solved this by enabling ASP.NET 4.5 feature:
and then following ken's answer.
To fix this open up the IIS Express applicationhost.config. This file is stored at C:\Users[your user name]\Documents\IISExpress\config\applicationhost.config
Update for VS2015+: config file location is $(solutionDir).vs\config\applicationhost.config
Look for the following lines
<section name="windowsAuthentication" overrideModeDefault="Deny" />
<section name="anonymousAuthentication" overrideModeDefault="Deny" />
<add name="WindowsAuthenticationModule" lockItem="true" />
<add name="AnonymousAuthenticationModule" lockItem="true" />
Change those lines to
<section name="windowsAuthentication" overrideModeDefault="Allow" />
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<add name="WindowsAuthenticationModule" lockItem="false" />
<add name="AnonymousAuthenticationModule" lockItem="false" />
Save it and refresh Asp.net Page.
In our case on IIS 8 we found the error was produced when attempting to view Authentication" for a site, when:
The server Feature Delegation marked as "Authentication - Windows" = "Read Only"
The site had a web.config that explicitly referenced windows authentication; e.g.,
Marking the site Feature Delegation "Authentication - Windows" = "Read/Write", the error went away. It appears that, with the feature marked "Read Only", the web.config is not allowed to reference it at all even to disable it, as this apparently constitutes a write.
Seems that with IIS Express and VS 2015, there's a copy of the applicationHost.config file at $(solutionDir).vs\config\applicationhost.config so you'll need to make changes there. See this link: http://digitaldrummerj.me/iis-express-windows-authentication/
Make sure these lines are changed per below:
<section name="windowsAuthentication" overrideModeDefault="Allow" />
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<add name="WindowsAuthenticationModule" lockItem="false" />
<add name="AnonymousAuthenticationModule" lockItem="false" />
In my case it was that on server was not enabled "HTTP Activation" under .NET Framework Features. So for Windows Server 2012 the solution which worked for me was:
Server Manager -> Add roles and features -> Features -> make sure that under .NET Framework of version you want to use is checked "HTTP Activation"
The Powershell way of enabling the features (Windows Server 2012 +) - trim as needed:
Install-WindowsFeature NET-Framework-Core
Install-WindowsFeature Web-Server -IncludeAllSubFeature
Install-WindowsFeature NET-Framework-Features -IncludeAllSubFeature
Install-WindowsFeature NET-Framework-45-ASPNET -IncludeAllSubFeature
Install-WindowsFeature Application-Server -IncludeAllSubFeature
Install-WindowsFeature MSMQ -IncludeAllSubFeature
Install-WindowsFeature WAS -IncludeAllSubFeature
The error says that the configuration section is locked at the parent level.
So it will not be directly 1 config file which will resolve the issue,
we need to go through the hierarchy of the config files to see the inheritance
Check the below link to go through the File hierarchy and inheritance in IIS
https://msdn.microsoft.com/en-us/library/ms178685.aspx
So you need to check for the app config settings in the below order
ApplicationHost.config in C:windows\system32\inetsrv\config. Change the overrideModeDefault attribute to be Allow.
ApplicationName.config or web.config in the applications directory
Web.config in the root directory.
Web.config in the specific website (My issue was found at this place).
Web.config of the root web (server's configuration)
machine.config of the machine (Root's web.config and machine.config can be found at - systemroot\MicrosoftNET\Framework\versionNumber\CONFIG\Machine.config)
Go carefully through all these configs in the order of 1 to 6 and you should find it.
I noticed one answer that was similar, but in my case I used the IIS Configured Editor to find the section I wanted to "unlock".
Then I copied the path and used it in my automation to unlock it prior to changing the sections I wanted to edit.
. "$($env:windir)\system32\inetsrv\appcmd" unlock config -section:system.webServer/security/authentication/windowsAuthentication
. "$($env:windir)\system32\inetsrv\appcmd" unlock config -section:system.webServer/security/authentication/anonymousAuthentication
I needed to change the SSL settings on a subfolder when i got this nice message. In my case following action helped me out.
Opened C:\Windows\System32\inetsrv\config\applicationHost.config
And changed the value from overrideModeDefault="Deny" to "Allow"
<sectionGroup name="system.webServer">
...
<sectionGroup name="security">
<section name="access" overrideModeDefault="Allow" />
</sectionGroup>
In my case, I got this error because I was operating on the wrong configuration file.
I was doing this:
Configuration config = serverManager.GetWebConfiguration(websiteName);
ConfigurationSection serverRuntimeSection = config.GetSection("system.webServer/serverRuntime");
serverRuntimeSection["alternateHostName"] = hostname;
instead of the correct code:
Configuration config = serverManager.GetApplicationHostConfiguration();
ConfigurationSection serverRuntimeSection = configApp.GetSection("system.webServer/serverRuntime", websiteName);
serverRuntimeSection["alternateHostName"] = hostname;
in other words, I was trying to operate on the website's web.config instead of the global file C:\Windows\System32\inetsrv\config\applicationHost.config, which has a section (or can have a section) for the website. The setting I was trying to change exists only in the applicationHost.config file.
In my case, it was something else.
When I loaded the solution in a new version of Visual Studio, VS apparently created a new project-specific applicationhost.config file:
MySolutionDir\.vs\config\applicationhost.config
It started using the settings from the new config, instead of my already customized global IIS Express settings.
(\Users\%USER%\Documents\IISExpress\config\applicationhost.config)
In my case this was the setting that needed to be set. Of course it could be something else for you:
<section name="ipSecurity" overrideModeDefault="Allow" />
Received this same issue after installing IIS 7 on Vista Home Premium. To correct error I changed the following values located in the applicationHost.config file located in Windows\system32\inetsrv.
Change all of the following values located in section -->
<div mce_keep="true"><section name="handlers" overrideModeDefault="Deny" /> change this value from "Deny" to "Allow"</div>
<div mce_keep="true"><section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" /> change this value from "Deny" to "Allow"</div>
Can You try this:
Go to application path where you're getting deny error, right click
Properties->Security tab
In that, change the permissions and check the checkbox read and write. Then it will work without any error hopefully.
For Windows Server 2008 and IIS 7, the procedure is similar.
please refer to this:
http://msdn.microsoft.com/en-us/library/vstudio/bb763178(v=vs.100).aspx
in add role service, u will see "Application Development Features"
Check (enable) the features. I checked all.
In my case I was getting this error when attempting to update the authentication settings in IIS also in addition to browsing. I was able to remove this error by removing the authentication setting from the web.config itself. Removing a problematic configuration section may be less invasive and preferable in some cases than changing the server roles and features too much:
Section Removed:
<security>
<authentication>
<windowsAuthentication enabled="true" />
</authentication>
</security>
I had the similar issue, but I used the following powershell script which helped me to achieve above steps in on button click.
#Install IIS
Import-Module ServerManager
Add-WindowsFeature Web-Server, Web-Asp-Net45, Web-Mgmt-Console, Web-Scripting-Tools, NET-WCF-HTTP-Activation45, Web-Windows-Auth
the list of features can be added or removed based on the requirement.
I had an issue where I was putting in the override = "Allow" values (mentioned here already)......but on a x64 bit system.......my 32 notepad++ was phantom saving them. Switching to Notepad (which is a 64bit application on a x64 bit O/S) allowed me to save the settings.
See :
http://dpotter.net/technical/2009/11/editing-applicationhostconfig-on-64-bit-windows/
The relevant text:
One of the problems I’m running down required that I view and possibly edit applicationHost.config. This file is located at %SystemRoot%\System32\inetsrv\config. Seems simple enough. I was able to find it from the command line easily, but when I went to load it in my favorite editor (Notepad++) I got a file not found error. Turns out that the System32 folder is redirected for 32-bit applications to SysWOW64. There appears to be no way to view the System32 folder using a 32-bit app. Go figure.
Fortunately, 64-bit versions of Windows ship with a 64-bit version of Notepad. As much as I dislike it, at least it works.
I had the same issue.
Resolved it by enabling Application Server feature. Restarted iis
after that.
This worked for me
Also in IIS 8 you can solve this problem by changing the server to IIS Express. Goto debug->Properties
In the Web select the server as IIS Express from the dropdown and then rebuild the solution
To make a change at Application Level (Web.Config):
Please remove the Trust Level from the web.config:
Actually I was getting this error when I was trying to host my Website on the Hosting Server where I don't have control on their Server. Removing the above line from my Application web.config solved my issue.
There are number of posts on this and I have tried many a things by now. But to no avail. Myself a Winforms Developer basically, started working on this Web stuff few days back as my company is taking Web initiatives.
I have a ASP.Net project and I want to host it on local IIS. In Project properties -> Web settings I chose Use Local IIS Server and gave a url as localhost/MyApp. I tried accessing it on my firefox browser and received error as HTTP Error 503. The service is unavailable.
Previously I got many other errors and I one by one fixed them all. But struck with this one. These are the settings I have in my project
Application Pool set to ASP.Net v4.0 Classic
App Pool Enable 32 bit Application property is true
App Pool is started
Project build property set to Any CPU for Target framework
But I would like to mention a weird behavior. Following is something that I am facing
Application Pool is Started
I try to access my local website (by giving url as localhost/MyApp)
I receive the error as HTTP Error 503. The service is unavailable
Application Pool is Stopped
I have seen following link and I have already tried it. For the above behavior I reached here. According to this link, Computer name should not have . in it. I don't have any . in my Computer name but do have - in it. Also my domain name contains . in it. Moreover I can't change these settings as its my office laptop and our TFS settings are bound to our Domain and Computer Names.
Can anyone help me to understand whats happening? Please guide me. Thanks.
Edit
I have following code in Global.asax. Application_BeginRequest method is empty in same file.
protected override void Application_Start(object sender, EventArgs e)
{
base.Application_Start(sender, e);
String _path = String.Concat(System.AppDomain.CurrentDomain.RelativeSearchPath, ";",
System.Environment.GetEnvironmentVariable("PATH"));
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process);
MyAppLog.Initialize();
MyAppLog.WriteMessage("Application Started");
}
Update
As per the suggestions in Comment, I am able to run the website from Cassini.
One possible reason this might happen is that the Application Pool in IIS is configured to run under some custom account and this account either doesn't exist or a wrong password has been provided, or the password has been changed. Look at the advanced properties of the Application Pool in IIS for which account it uses.
Also the Event Log might contain more information as to why the Application Pool is stopping immediately on the first request.
Ok, I have another solution for one specific case: if you use WINDOWS 10, and you updated it recently (with Anniversary Update package) you need to follow the steps below:
Check your Windows Event Viewer - press Win+R and type: eventvwr, then press ENTER.
On the left side of Windows Event Viewer click on Windows Logs -> Application.
Now you need to find some ERRORS for source IIS-W3SVC-WP in middle window.
Probably you will see message like:
The Module DLL >>path-to-DLL<< failed to load. The data is the error.
You have to go to Control Panel -> Program and Features and depending on which dll cannot be load you need to repair another module:
for rewrite.dll - find IIS URL Rewrite Module 2 and click Change->Repair
for aspnetcore.dll - find Microsoft .NET Core 1.0.0 - VS 2015 Tooling ... and click Change->Repair.
Restart your computer.
For my situation is that my login password changed, while the application pool still uses the old one. So just click the "Advanced Settings" of your application pool and reset your "Identity".
I was facing the same problem, and debugged it using the event logs. First it said that : "The description for Event ID 5059 from source Microsoft-Windows-WAS cannot be found".
I then turned on WAS using turn windows features on/off. Then i saw this in eventvwr
"Microsoft-Windows-DistributedCOM cannot be found".
Finally I gave up and deleted the App Pool (that used to stop on accessing the website) and created it again, as it is. This resolved the problem.
Most of Time, it was occured due to AppPool Setting.
Check the following to resolve this
Check Apppool service is running.
Check Identity of AppPool.
Enter the new password if it has changed for that identity.
The following Images show these setting in IIS
For anyone coming here with Windows 10 and after updating them to Anniversary update, please check this link, it helped me:
https://orcharddojo.net/blog/troubleshooting-iis-apppool-crashes-status-503-after-windows-10-anniversary-update
In case link goes down:
If your Event log shows that aspnetcore.dll, rewrite.dll (most often, but could be others as well) failed to load, you have to repair the missing items.
Here are two specific issues we've experienced so far and how to fix them, but you may bump into completely different ones:
"C:\WINDOWS\system32\inetsrv\rewrite.dll" (reference)
Go to "Programs and Features" (Win+X, F) and repair "IIS URL Rewrite Module 2".
"C:\WINDOWS\system32\inetsrv\aspnetcore.dll" (reference)
Go to "Programs and Features" (Win+X, F) and repair "Microsoft .NET Core 1.0.0 - VS 2015 Tooling ...".
If you have McAfee HIPS and if you see the following error in event viewer application log:
The Module DLL C:\Windows\System32\inetsrv\HipIISEngineStub.dll failed to load.
The data is the error.
Then the following resolved the issue in my case:
https://kc.mcafee.com/corporate/index?page=content&id=KB72677&actp=LIST
Quote from the page:
Click Start, Run, type explorer and click OK.
Navigate to: %windir%\system32\inetsrv\config
Open the file applicationHost.config as Administrator for editing in Notepad.
Edit the <globalModules> section and remove the following line:
<add name="MfeEngine" image="%windir%\System32\inetsrv\HipIISEngineStub.dll" />
Edit the <modules> section and remove the following line:
<add name="MfeEngine" />
After you have finished editing the applicationHost.config file, save the file, then restart the IIS server using iisreset or by restarting the system.
In my case I checked event logs and found error was
Cannot read configuration file ' trying to read configuration data from file '\\?\', line number '0'. The data field contains the error code.
The error code was 2307.
I deleted all files in C:\inetpub\temp\appPools and restarted the iis. It fixed the issue.
I had a similar issue. I solved it by adding my user to the "Log on as a batch job" policy under "Local Security Policy" > "Local Policies" > "User Rights Assignment".
When I first time add the service and created the app pool for it.
I did "iisreset" from command prompt, and it worked.
I was experiencing this error and in my case the cause was that some time ago I modified the user password, and the 503 error didn't appears till I restarted the application pool.
So I fixed it setting the new password on Applications Pools / Advanced Settings / Identity / [...] / Set... / Password / Confirm Password
If you can run the website in Visual Studio debugger, then might be able to see where in your code the application pool is crashing. In my case, it was a function being called recursively an unlimited number of times, and that caused a stack overflow. Note: the Windows event log and the IIS logs were not helpful to diagnose the problem.
I had the same issue with iis 8.5. After searching the eventViewer under windows Logs-->applications, I realized that I'm having a permission error for the machine.config file of the .net framework located at "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config".
Giving it a permission for IIS_IUSRS solved my problem (right click the file-->properties-->security-->edit-->add-->IIS_IUSRS)
Just to add to these Anniversary Update issues (thanks Microsoft) if the file you are missing is cgi.dll, ie your Event Viewer has
The Module DLL C:\WINDOWS\System32\inetsrv\cgi.dll failed to load. The data is the error.
Then to fix this:
Go to IIS Manager
Select the very top row in the Connections panel (typically your PC name)
At the very bottom of the right panel, under Management, you should have Web Platform Installer
Once that loads, select Products
In the search type in cgi then hit <Enter>
Select IIS: CGI then click Add on the right and finally Install on the bottom
After installing it should force you to restart your PC and you should be fixed.
To Fix the problem, Follow the steps as I faced the same issue and below solution worked for me
1- Give full Rights or at least read access rights of Folder "C:\inetpub\temp" to IIS_IUSRS
2- also check same rights given to User IIS_IUSRS of folder "C:\inetpub\wwwroot".
hope this solution works!
I had a similar issue, all my app pools were stopping whenever a web request was made to them. Although I was getting the following error in the Event Viewer:
The worker process for application pool 'appPoolName' encountered an
error 'Configuration file is not well-formed XML ' trying to read
configuration data from file
'\?\C:\inetpub\temp\apppools\appPoolName\appPoolName.config', line
number '3'. The data field contains the error code.
Which told me that there were errors in the application.config at:
C:\Windows\System32\inetsrv\config\applicationHost.config
In my scenario, I edited the web.config on deploy with an element IIS clearly dislikes, the applicationHost.config scraped the web.config and inserted this bad element and wouldn't resolve until I manually removed it
In addition to the steps outlined at this link from Orhan's answer, you may need to additionally remove the native module by going to IIS Manager > Server Root > Modules > Configure Native Modules. Select MfeEngine and then select Remove.
Changing "Managed Pipeline Mode" from "Classic" to "Integrated" worked for me.
It can be changed at Application Pools -> Basic Settings
One possible reason this might happen is that you don't have enough disk space in your server machine. You can find more information in event viewer.
if such thing happen, just stop the IIS, clean some free disk space and restart the IIS and then start the App Poll.
Such 503 errors were encountered on our side on Windows Server 2019 while setting up a fresh new Classic ASP website.
In fact, in the App Pool, setting ".NET CLR Version" to "No Managed code" caused the App Pool to stops 2 seconds after being started, thus generating WAS 5002 and 5021 errors in the Windows Event Log.
The solution was to put "v4.0", even if no .NET is used.
I'm late to the party, but the solution that worked for me isn't listed.
The solution for me was simply to delete the web site and application pool within IIS, and re-create them.
This is because originally I had create the site/folder first, then installed the dotnet core runtime. For some reason this failed to allow the site to start up.
Once re-created, the site came to life with none of the other suggestions being required.
In my case, the web sites displayed "503 Service unavailable" and the application event log showed "...\aspnetcorev2.dll failed to load. The data is the error." This only happened for IIS sites where where the IIS setting "Enable 32-Bit Applications" was True. The system was stopping the app pools for these sites, which is what generated the "503 Service unavailable" message when trying to retrieve the site.
It turns out the path specified in this application event log didn't even exist. Trying to repair the two "Microsoft.NET Core SDK 2.1.50x" versions installed on the system didn't resolve the issue, nor did installing the latest and only aspnetcorev2.dll that Microsoft seems to have available, nor did uninstalling these SDKs.
NOTE: Microsoft doesn't even seem to have the installers available anymore for the original v2 ASP.NET Core versions that had been installed on my system.
What worked:
Since I don't have any ASP.NET Core sites on this system, the solution that worked for me was to uninstall all the related DLLs from my system and to remove them from the IIS applicationhost.config file by commenting them out (see aspnetcore.dll failed to load and applicationhost.config file path in IIS 7, 7.5, 8, 8.5 and IIS 10?). If you do use a later version of ASP.NET Core, I'd think you could just as well update the references in applicationhost.config [I haven't tried that].
In my case this application pool automatically stopped due to error log folder I created in local which is not exist in server. Check the web.config file whether any key path you added which is exist in server or not.
Will this answer Help you?
If you are receiving the following message in the EventViewer
The Module DLL aspnetcorev2.dll failed to load. The data is the error.
Then yes this will solve your problem
To check your event Viewer
press Win+R and type: eventvwr, then press ENTER.
On the left side of Windows Event Viewer click on Windows Logs -> Application.
Now you need to find some ERRORS for source IIS-W3SVC-WP in the middle window.
if you receiving the previous message error then solution is :
Install Microsoft Visual C++ 2015 Redistributable 86x AND 64X (both of them)
Source
In my case error message displaed in Windows Event Viewer -> Windows Logs -> Application was "The Module DLL C:\Windows\system32\inetsrv\rewrite.dll failed to load. The data is the error."
Uninstalling rewrite module via installer solved the problem. I wasn't using any rewrite rules so I uninstalled rewrite module. Reinstalling the module may help the problem as well.
I just had this issue on some legacy servers running Windows 2008 R2. 32bit applications would crash the app pool and return a 503 without hitting the app code. The problem seems to be related to .net core module erroneously trying to load the 64bit version of the module even though the 32bit application in question was not a .net core app.
It seems that IIS still loads the module when figuring out which module to load to service the request and trying to load a 64bit version into a 32bit process is no bueno.
In the end, I had to uninstall all versions of .net core from the server and reinstall the latest (at this time 3.1.15- we're not using 5 yet). After that my 32bit apps and .net core apps could coexist on the same server.
This is the blog post that helped me resolve this after days of banging my head on it. Hopefully it helps someone out.
Blog post with the solution
Give full Rights rights to Folder "C:\inetpub"
Work for me!
Check the log written to [event viewer\Windows Logs\System] node.
Source is 'WAS'.
Before everyone reads this, I just want to say that i know that there are related threads out there, but I have either tried them or do not understand. With that being said here goes nothing...
I am trying to get a MVC Web App running in my IIS. Unfortunately, I am absolutely stuck on this error:
HTTP Error 500.19 - Internal Server Error
The Request page cannot be accessed becasue the related configuration data for
the page is invalid.
Module: IIS Web Core
Notification: BeginRequest
Handler: Not yet determined
Error Code: 0x80070005
Config Error: Cannot read configuration file due to insufficient permissions
Config File: \foo\web.config
Request URL: http://localhost/WEBAPP
Logon Method: Not yet determined
Logon User: Not yet determined
Config Source
-1:
0:
I am not quite sure what else to do. I have also tried giving read permission to the web.config file and that did not seem to work.
If anyone has any information or would be able to help me work through this it would be much appreciated. Thanks!
In my case I needed to install the IIS URL rewrite module 2.0 because it is being used in the web.config and this was the first time running site on new machine.
On this MSDN blog: Troubleshooting HTTP 500.19 Errors in IIS 7 in scenario 8 for error code 0x80070005 (E_ACCESSDENIED - General access denied error) it says:
Grant Read permission to the IIS_IUSRS group ...
.... the worker process identity (and/or the IIS_IUSRS group) needs at least Read access to the directory so that it can check for a web.config file in that directory.
Please follow these step
Go to Control Panel
Go to Programs and Features
Turn Window Feature on or off
Go to Internet Information Service node
Follow World wide web Services
Then Please Check Application Development Feature
Then Please check all Node Specially Asp or Application Framework Like Asp.net 3.5 or ASP.NET 4.5 whatever you have
I fixed this by restarting VS.
I had opened a config file in another instance of VS and apparently sth went nuts...
Goto Windows Features on or Off . Enable All Features under Application Development Features and Refresh the IIS. Its Working
I was trying to run a .net core 3.1 site from IIS 10 on windows 10 pro box, and got this error. Did the following to resolve it.
First turn on the following iis feature on.
Then follow the link below.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle
Install the .net core hosting bundle.
The direct link is
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.2-windows-hosting-bundle-installer
I have installed the .net core sdk and run time as well. But this did not resolve the issue.
What made the difference is the .net core hosting bundle.
I had a sub folder named web.config renaming this folder resolved the issue
For completeness, the answer to Asp.Net Core tag in web.config causes failure may also be the solution to the problem here. If the .NET Core Windows Server Hosting bundle is not installed then IIS cannot recognize the aspNetCore section in web.config. https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle claims to be a direct download to the current version.
I tried all solution above. My issue is resolved after reinstalling hosting bundle.
I installed hosting bundle before in IIS Manager installation.
I think this is caused error. Don't know why, but, the reinstallation works.
My issue is that I accidentally installed another site as the default site instead of the IIS default (by opening another project.) I had to remove the default site and repoint it to the default location C:\inetpub\wwwroot using my domain login as the user to bypass with then just reopened my project that I was trying to run (the one showing this error) and it was all honky dorry
I was accessing the project from inside a Virtual Machine - sharing the project folder from the host OS (Windows 10). After trying many of the solutions, and even ensuring the permissions for the IIS_IUSRS are given, still I could solve this.
Eventually, I copied this folder from the host, onto a path on the guest OS, and now I can properly run that same ASP.NET project without ado. But, I did also go ahead and give the IIS_IUSRS group full control over this new dir as well... maybe that's not really necessary in this case? I'm lazy to test that ATM.
Delete .vs/Config folder => work for me
In my case I had .Net core SDK 3.1.403 was installed. So I installed the corresponding .Net Core Windows Server Hosting which is .NET core 3.1.9 - Windows Server Hosting.
I had this problem to run restful service on IIS in Windows 10 and Windows Server 2019, finally after a lot of researches I solved the problem. After performing the following steps, the problem will most likely be solved.
Go to the "Windows Features" and active full features IIS ("Internet Information Services" or "Web Server") and active .Net Features
Locate the source at "C:\inetpub\wwwroot"
Open IIS
Click "Edit Permissions" on your web after go to the security tab and give full
access to the IIS_IUSRS
Go to the "Application Pool" next right click on your app pool after click on "Advanced settings" and change "Identity" to "LocalSystem"
Go to the "Application Pool" next right click on your app pool after click on "Basic settings" and change ".NET CLR Version" to "No Managed Code"
If you want to set the service to a specific port, first set it to port 80 and then edit it and set your port
Well now if the problem is still not solved then install the following software on the system :
URL Rewrite 2
WebPlatform
DotNetCore.2.0.8 Windows-Hosting
Dotnet-hosting 5
Dotnet-runtime 5
MicrosoftServiceFabricSDK 5
NET.Framework 4.8
and finally restart the system.
If Folder getting from other, and host file is already generated on ProjectName\.vs\config folder, then it conflicts with a new one and gets this error.
So delete host file from ProjectName\.vs\config and restart project once again. It was worked for me
In my case, Server had lower version framework than your application. installed latest version framework and it fixed this issue.
In the Edit Application Pool window, set the .NET CLR version to No Managed Code
I had this error with Visual Studion 2019, my project was NopCommerce 4.30 which is an ASP.Net Core 3.1 project. I added page "gouden-munten-buitenland" to be the starting page and I only got the error when going to that page. Turned out that Visual Studio generated an invalid applicationHost.config :
<applicationPools>
....
<add name="gouden-munten-buitenland AppPool" autoStart="true" />
<add name="gouden-munten-buitenland AppPool 2" autoStart="true" /> <!-- WRONG -->
<add name="Nop.Web AppPool" managedRuntimeVersion="" />
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>
</applicationPools>
and
<sites>
....
<site name="Nop.Web" id="2">
...
<application path="/gouden-munten-buitenland/gouden-munten-buitenland" applicationPool="gouden-munten-buitenland AppPool">
<virtualDirectory path="/" physicalPath="C:\Usr\Stephan\Wrk\Kevelam\kNop.430\Presentation\Nop.Web" />
</application>
<application path="/gouden-munten-buitenland" applicationPool="gouden-munten-buitenland AppPool 2">
<virtualDirectory path="/" physicalPath="C:\Usr\Stephan\Wrk\Kevelam\kNop.430\Presentation\Nop.Web" />
</application> <!-- WRONG -->
....
</site>
...
</sites>
I removed the nodes identified as 'WRONG' and then it worked.
If your error is using a site in asp.net core, install the ASP.NET Core Windows hosting bundle.
Click on the link below and select your .net core version
In the following page find the link "Hosting bundle" (ctrl+f may help) and install it.
Worked a treat for me!
https://dotnet.microsoft.com/en-us/download/dotnet
One reason, for which I face this issue was a web.config file in Images folder (on abnormal location) and IIS was trying to allow the read rights according to incorrect settings in the web.config file.
Therefore make sure your build is correctly deployed without any abnormal files specially the configs one on invalid locaiton.
I have a Web Application that I received from another developer, when I first opened the solution in Visual Studio 2010, it gave a message that the URL for the application has not been created in IIS and do I want Visual Studio to set up a virtual folder. I clicked "yes", and in the IIS manager I see that the virtual folder has been created. I also went to directory security for the virtual folder and enabled integrated windows authentication.
The problem is that when I try launch the application, changes to "running", but a browser windows is not opened and if I look in inetpub\wwwroot I do not see a folder for my application. Another thing I noticed, is that in the properties for the virtual folder in IIS, under the tab ASP.Net, there is a dropdown box called ASP.Net version; this dropdown box only has options 2.0.50727 and 4.0.30319 whereas the application that I am trying to launch is targetting .Net framework 3.5. The .Net framework 3.5 is installed on the computer so I have no idea why it is not being shown in this dropdown box. Maybe it is relevant to the problem I am experiencing?? The IIS version running on my computer is IIS 6.
Does anyone know what could be going wrong here and how I can fix it? Thanks.
EDIT: Ok. Now I am a step further. I have changed the start action under the Web section of the solution properties to be Specific page: Default.aspx; this setting was on Don't open a page. (Thanks, anirudh4444 for this info). Now the browser opens when I click run, and I briefly see it attempting to go to the correct url (namely, http://localhost/ripcord/default.aspx), but it immediately changes to http://www.ripcord.co.za/default.aspx, which is the site where this project was previously hosted. It then displays "The remote server returned an error: (400) Bad Request." If I manually put in the local url then I get a popup box showing asking me for a username and password.
EDIT 2: I added a stack trace here, but have removed it because it is not relevant to the problem that I am encountering. This stack trace, I have determined, is actually showing an exception occurring on the remote site. My problem is that when I try and navigate to http://localhost/ripcord that it is redirecting to the remote site. I am needing to stop it doing that and instead execute the application locally.
Redirection can occur in several places: the web.config settings (like an in a tag), in IIS configuration, in the project settings (like start up behavior), or in code.
Do a search in your code and config files to find 'http://www.ripcord.co.za' to see if it is your code. Then look at IIS settings.
What does the customErrors in your Web.config look like? Does it use a relative path or an absolute path?
<customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx">
<error statusCode="404" redirect="~/errors/PageNotFound.aspx" />
</customErrors>
If an exception is thrown and not handled, the custom errors will use the redirect settings