IIS Web Core Issue - The requested page cannot be accessed because the related configuration data for the page is invalid - iis-7.5

I am getting this following issue. What can be possible reason.
The requested page cannot be accessed because the related configuration data for the page is invalid.

For me all I did was delete the file web.config . However, my serverside was ColdFusion which has in-built functionality to do a deepsearch of web.config starting from the parent directory to the internal ones. so I had a web.config file in one of the inner directories.

Related

HTTP Error 404.3 - Not Found in Azure with asp.net MVC and WebAPI core 2.1

Hi All I am getting below error, There is no publishing error. and also checked by deploying a MVC core 2.1 application which is generated by VS 2017 and the application also contains the font file. In that it does not produce any error and runs fine. But the project its giving below exception and the details are...
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Most likely causes:
It is possible that a handler mapping is missing. By default, the static file handler processes all content.
The feature you are trying to use may not be installed.
The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
If ASP.NET is not installed.
Things you can try:
In system.webServer/handlers:
Ensure that the expected handler for the current page is mapped.
Pay extra attention to preconditions (for example, runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.
Pay extra attention to typographical errors in the expected handler line.
Please verify that the feature you are trying to use is installed.
Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.
To set a MIME type, use the following syntax: %SystemRoot%\windows\system32\inetsrv\appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']
The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.
For example, to add a MIME map for a file which has the extension ".xyz": appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']
Warning: Ensure that this MIME mapping is needed for your Web server before adding it to the list. Configuration files such as .CONFIG or dynamic scripting pages such as .ASP or .ASPX, should not be downloaded directly and should always be processed through a handler. Other files such as database files or those used to store configuration, like .XML or .MDF, are sometimes used to store configuration information. Determine if clients can download these file types before enabling them.
Install ASP.NET.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032
Requested URL https://~1GpsLearning:80/Content/fonts/glyphicons-halflings-regular.woff
Physical Path D:\Program Files (x86)\SiteExtensions\Kudu\79.20129.3767\Content\fonts\glyphicons-halflings-regular.woff
Logon Method Anonymous
Logon User Anonymous
It was the issue of up-gradation from 2.0 to 2.1, SO I created a fresh application in 2.1 core and just implemented my other code as it is and every thing worked fine and is running on azure very smoothly.

Default Document not working on Azure Web App

I have a simple azure web app and have set the default document in the portal to home.aspx. There is a home.aspx file published, it is browsable via http://my-domain.azurewebsites.net/home.aspx (not real domain) however the default document won't work when browsing to http://my-domain.azurewebsites.net it returns a 404. There is nothing special here. I even added it to the web.confg and it still returns a 404. It is a web forms project, set to integrated security with the correct default document added. Any ideas?
I setup the following web app (West): supportforlucuma There is only one other app in that plan which is the one that isn't working.
I can see the home.html page by visit “http://supportforlucuma.azurewebsites.net/”, Is your issue solved? If no, I will provide more information of how to debug this issue.
Except to set default document on portal and web.config, the default document also could be set in RouteConfig.cs file. For example, following code will set the index.aspx as the default page of current web application and it has the highest priority. If index.aspx file is not exist, a 404 error will response to client. Please check whether the similar code is exist in RouteConfig.cs file.
routes.MapPageRoute("default", "{page}", "~/{page}.aspx",false,new RouteValueDictionary( new { page = "index" }));
For further troubleshooting this issue, we can to get the detail information of 404 response. For example, which modules are executed on server side during the default page is accessed. To do it, we need to enable Failed request tracing. Then we could see the detail information by download the tracing log from LogFiles folder. For example, "ftp://xx.ftp.azurewebsites.windows.net/LogFiles/W3SVC355162095/".

IIS 8.5 virtual directory not serving default document

Seems like with the default settings, a newly created virtual directory does not serve the default files it contains. How can I enable this?
app <- .net app available at domain.com/
/virtualdir/index.htm <- default file in a virtual directory
I would like to make it possible for requests to domain.com/virtualdir to serve domain.com/virtualdir/index.htm
Currently domain.com/virtualdir/index.htm works as desired, but domain.com/virtualdir returns a 404.
Any ideas? I think I might need to add something to a webconfig file in virtualdir but not quite sure what. index.htm is already in the list of default documents.
Detailed Error Information:
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler ek*
Error Code 0x00000000
Requested URL http://localhost:80/virtualdir/
Physical Path C:\inetpub\extras\virtualdir\
Logon Method Anonymous
Logon User Anonymous

Reference to JS file prompts logon

I want to reference a javascript file at the bottom of a page template.
I added the .js file under cmssitemanager / development / javascript files and then added the following to the master template (portal engine):
<script src="/CMSScripts/Custom/FOO/BAR.js"></script>
When I open the page in any browser, the javascript in the file isn't executing.
When try to access the file directly in the browser at domain.com/CMSScripts/Custom/FOO/BAR.js I get redirected to the Kentico logon page.
I don't see how/where I can specify security for the CMSScripts directory, but the user should not have to be logged in to access this file.
Any suggestions?
Update with info from first answer:
We are not currently using Windows Authentication, and I verified that the application pool user account has file-system permissions. I also verified that the application can add/delete/modify files using the cmssitemanager > administration > system > files > "test files" utility which resulted in OK status for creating/deleting/modifying folders and files.
I do have Check files permission checked in cmssitemanager > settings > system > files > security. Unchecking this option does not change the behavior, including after restarting both the application and the windows services.
The site is valid and has the correct license however there was NOT a domain alias defined. I added one however this did not change the behavior.
We have not made any changes to the web.config save for connection string information. If you are referring to this documentation on CMSUseTrailingSlashOnlyForExtensionLess in the web.config, this was not previously in there however adding it did not change anything. To that end, I wasn't seeing the site trying to redirect to domain.com/CMSScripts/Custom/FOO/BAR.js/ so I truly think it's tied to some kind of security ACL that is out of order.
Here is the solution provided by user FroggEye on the Kentico DevNet forum thread on this same issue:
You're best bet is to use the syntax below. Kentico does URL processing on all directories unless excluded and you'd have to exclude the CMSScripts directory from processing which isn't hard but the code below is a better solution.
<script src="/CMSPages/GetResource.ashx?scriptfile=/CMSScripts/Custom/FOO/BAR.js" type="text/javascript"></script>
This will do 2 things:
give you a standard place to call resources from (you can get stylesheets here as well)
allow you to use the build-in minimization functions.
Charles,
This is a strange behavior, it does not normally do that.
Do you have any windows auth going on ? where you possibly removed anonymous access (in IIS) to directories in the website folder ?
Do you have Check Files permissions turned on as a Kentico Site setting? (even though I'm fairly sure that won't affect requests to the JavaScript files in JS module)
Is it a valid site (enabled and running in CMSSiteManager) and domain name with a correct license and alias ?
Any custom modifications to web.config file that possibly changed httpHandlers or modules ? And are you running the correct extensionless URL settings in web.config ?

problem using a custom 404 page in IIS

I have a web site with a child directory set up as an application. I set up the application to use a custom 404 page. When I navigate to the url and put in a non existent page I get the following error message. Any other asp page in the application works fine. There isn't even any script in the 404 page... just plain html so I'm not sure what is causing this. I've tried creating an application pool specifically for this application but that didn't help. Thanks.
Error message: The specified request cannot be executed from current Application Pool
Try to create a registry key with the name IgnoreAppPoolForCustomErrors (type DWORD, value 1) in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\
See http://blogs.msdn.com/rakkimk/archive/2006/09/01/735684.aspx or http://www.yanghengfei.com/show-131-1.html for more information - seems to be a not so uncommon problem.

Resources