Invalid application path - iis-7

IIS7 Windows 7 64bit
No matter what I do I can't seem to add an application to a web site.
When I 'Test settings' I get "Invalid application path".
Any one have a guess as to what I could be doing wrong?

When I got this error it appeared to be due to a security setting. When I changed the "Connect As" property to an administrator then I no longer got the message.
Obviously this isn't a good solution for a production environment - one should probably grant the least privileges necessary for the user IIS is going to be using by default. I'll update this answer if I learn more.

The error message might be a bug. I ignored it and everything worked for me.
See Here: http://forums.iis.net/t/1177952.aspx
and here http://forums.iis.net/p/1182820/2000936.aspx

I eventually tracked this down to the Anonymous Authentication Credentials. I don't know what had changed, because this application used to work, but anyway, this is what I did:
Click on the Application -> Authentication. Make sure Anonymous Authentication is enabled (it was, in my case), but also click on Edit... and change the anonymous user identity to "Application pool identity" not "Specific user". Making this change worked for me.
Regards.

Go to your HTTP bindings in IIS (select your website, then on the right click on Bindings...).
Delete your SSL and your HTTP binding. Re-Add them.
This usually fixes this for me.

Try : Internet Information Services (IIS) Manager -> Default Web Site -> Click Error Pages properties and select Detail errors

Problem was installing iis manager after .net framework aspnet_regiis had run. Run run aspnet_regiis from x64 .net framework directory
aspnet_regiis -iru // From x64 .net framework directory
IIS Manager can't configure .NET Compilation on .NET 4 Applications

I was also getting this error, I found that it was because I had deleted the Default Application Pool "DefaultAppPool". Re-creating it fixed the problem. Drove me crazy for a few days.
This error will appear if either the web application is mapped to a non-existent app-pool; or if that application pool is stopped.

I also had this error.
My IIS Website has a Default Website with three (3) application directories below it.
I had each of my 3 application directories configured correctly to use .NET Framework v2.0 in the Application Pools.
However, the Default Website never was configured. I didn't think it was necessary since all of my apps were contained within it.
My IIS Server's default configuration is .NET Framework v4.0, so I changed that to .NET v2.0:
After I did that, I no longer received the same error message.
Now, I see this:
I hope this information helps others.

I was also getting this error. The problem for me turned out to be that I had two separate websites on the machine, and I had not designated which address went to which website. To resolve this, go to IIS Manager -> Select Web Site -> Bindings -> Add... -> Enter the host name that you want to resolve for this website. Repeat for any other websites on the machine.
HTH. Rick

I had a similar issue today. It was caused by skype! A recent update to skype had re-enabled port 80 and 443 as alternatives to incoming connections.
H/T : http://www.codeproject.com/Questions/549157/unableplustoplusstartplusdebuggingplusonplustheplu
To disable, go to skype > options > Advanced > Connections and uncheck "Use port 80 and 443 as alternatives to incoming connections"

I still haven’t find a solution, but find a workaround.
You can manually change IIS configuration, in system32\intsrv\config\applicationHost.config. Just manually create (copy-paste) section in <sites> and <location>.

This worked for me. (btw its not recommended.)
For my test app , I created a new application pool and changed its Identity to "NetworkService" .
More about App Pool Identities here
http://www.iis.net/learn/manage/configuring-security/application-pool-identities
and
http://www.iis.net/learn/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis
You have to make sure that "NetworkService" has rights on your application's physical path.

even it was getting the above error. i found out that IIS was not registered on the server.
registering the iis fixed the issue.
Thanks,

In my case I had virtual dir. When I accessed main WCF Service in main dir it was working fine but accessing WCF service in virtual dir was throwing an error.
I had following code in web.config for both main and virtual dir.
<security>
<requestFiltering>
<denyQueryStringSequences>
<add sequence=".." />
</denyQueryStringSequences>
</requestFiltering>
</security>
by removing from web.config in virtual dir it fixed it.

I was able to correct the flaw by changing the file below:
C:\Windows\System32\inetsrv\config\applicationHost.config
In:
<application path="/" applicationPool="ASP.NET v4.0">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\Bonobo.Git.Server" />
</application>
<application path="/Bonobo.Git.Server" applicationPool="ASP.NET v4.0">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\Bonobo.Git.Server" />
</application>
For:
<application path="/">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\" />
</application>
<application path="/Bonobo.Git.Server" applicationPool="ASP.NET v4.0">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\Bonobo.Git.Server" />
</application>

Related

IIS Express Does Not Seem to Be Picking Up Changes to applicationhost.config

I followed the accepted answer to this question to try to get my .Net web application to run under a specific set of credentials when debugging locally via the IIS Express server running on my machine, however, I can't seem to get the changes to pick up. Admittedly, I have no idea how to verify what is actually happening, but the behavior I'm seeing leads me to believe that the web app just continues to run under my own Windows credentials. I've stopped the IIS Express processes via System Manager and also restarted my computer, but no dice. Here's what I have in my applicationhost.config file...
<applicationPoolDefaults managedRuntimeLoader="v4.0">
<processModel userName="username" password="a_strong_pwd" />
</applicationPoolDefaults>
Try adding an indentityType="SpecificUser" attribute:
<applicationPoolDefaults managedRuntimeLoader="v4.0">
<processModel indentityType="SpecificUser" userName="someName" password="a_strong_pwd" />
</applicationPoolDefaults>
The settings are detailed in: https://msdn.microsoft.com/en-us/library/ms689446(v=vs.90).aspx
What fixed things for me was editing %userprofile%\documents\IISExpress\config\applicationhost.config. Apparently, it overrides the applicationhost.config that Visual Studio points to.

IIS Application Initialization not Firing into ASP.NET Application

Running on Windows 8, I have enabled the Application Initialization feature of IIS from the Windows Features install options for IIS.
I'm attempting to get an ASP.NET Web app to start up immediately and fire into Application_Start when the Application Pool is restarted. I've followed the instructions from this tutorial, but after setting the values in the ApplicationHost.config, and web.config I see nothing is firing.
Here's what I've set (which seems to match what the article suggests):
<applicationPools>
<add name="MPress" autoStart="true"
enable32BitAppOnWin64="true"
startMode="AlwaysRunning">
<processModel identityType="LocalSystem" setProfileEnvironment="true" />
</applicationPools>
<sites>
<site>
<application path="/MPress.Workflow.WebQueueMessageManager"
applicationPool="MPress" preloadEnabled="true">
<virtualDirectory path="/" physicalPath="C:\Projects2010\Clients\MPress\MarvelPress.Workflow.WebQueueMessageManager" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
</site>
</sites>
And then in the local web.config I have:
<system.webServer>
<applicationInitialization remapManagedRequestsTo="Startup.htm"
skipManagedModules="true"
doAppInitAfterRestart="true">
<add initializationPage="default.aspx" />
</applicationInitialization>
</system.webServer>
Other than the doAppInitAfterRestart flag this matches the settings in the above article exactly except pointing at my virtual app and application pool.
It appears that the Application Pool auto load works - if I stop and restart IIS w3wp I see the application pool show in the task list. But using Process Explorer I can see that the EXE hasn't loaded .NET just sitting there. No .NET Runtime dlls are loaded, so it appears that no request has fired.
What really sucks is that there's no real documentation of section and expected values required for each setting. The doAppInitAfterRestart flag is documented nowhere that I could find. I've also left that out with the same results. I'm also not 100% what the syntax for the URL is. The MSDN article points at "/default.aspx" and I tried that too to no avail.
I also turned on Failed Request Tracing in IIS to see if maybe the fake request fails somehow, but nothing shows up in there. It simply looks like Site Level load is not firing when the application pool restarted.
All of the settings mentioned here are also available through the IIS Admin UI in Windows 8 and everything certainly looks correct.
I'm out of ideas on what else to check or what I might be missing. Any ideas appreciated.
After some more spelunking it turns out that although I had installed the Application Initialization feature using the Windows 8 features, the actual module was not added to the globalModules list.
The following was missing and once added everything started working just fine:
<globalModules>
<add name="ApplicationInitializationModule" image="%windir%\System32\inetsrv\warmup.dll" />
</globalModules>
I faced similar issue but after doing a bit of comparison I found that you need to set Application Pool Managed Pipeline Mode to Integrated. It will not work with Classic Mode

User.Identity.Name with windows authentication

I have a very simple partial view in my header called AccountInfoPanel.
It only has one line:
Welcome: #HttpContext.Current.User.Identity.Name
And in my Web.Config I have
<authentication mode="Windows" />
But the identity name is always empty.
If I debug through VS 2012, and break on the index action, I see it is empty.
If I run it through IIS with Windows Authentication Enabled and Anonymous Authentication diabled, I get a challenge.
So I try to plug in My account or a test1 and test2 account.
It comes back and says:
HTTP Error 401.1 - Unauthorized
You do not have permission to view this directory or page using the credentials that you supplied.
I also tried setting Impersonation to true and get the same response from the challenge.
Does anyone know how to set this up?
And if all the setup has to done in IIS, how do you debug your code within Visual Studio?
One other question. My boss seems to think you don't even need a login box. IE would just know who you are. And you could "run as" in IE with a different account.
Check one of possible issues on my checklist
http://netpl.blogspot.com/2012/06/iis-75-integrated-security-with-no.html
In short:
First, make sure that Anonymous Authentication is turned OFF for the site:
Second, enable integrated security in Interner Explorer (Options/Advanced and checkin the “Enable Integrated Windows Authentication” option).
Third, add your website to Local Intranet zone and select at least “Automatic logon only in Intranet Zone” option under Options/Security Settings/Local intranet/Custom level).
Fourth, make sure the user and application server are in the same domain.
To solve the problem, you have to enable the Windows Authentication feature. Follow the below steps:
-Click Start, and then click Control Panel. Open the Programs group.
-Under Programs and -Features, click Turn Windows Features on or off.
-Expand the item labeled Internet Information Services.
-Expand the item labeled World Wide Web Services. -Expand the item Security ->
Make sure to select Windows Authentication
Also you need to disable Anonymous Authentication from the IIS as follows: -Click on your application in IIS -Double click Authentication under IIS group -Click on Anonymous Authentication -Click on Disable on the right side under Actions. Hope this helps
Visual Studio installs IIS Express to serve web applications, so you have to configure it to use Windows Authentication.
Configuration file for IIS Express is usually here (more info: Where is the IIS Express configuration / metabase file found?):
%userprofile%\documents\iisexpress\config\applicationhost.config
Disable Anonymous authentication (enabled by default):
<anonymousAuthentication enabled="false" userName="" />
Enable Windows Authentication (disabled by default):
<windowsAuthentication enabled="true">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
I know this is an old question, but since it's not answered maybe someone could use my tip. I've been struggling with such an issue for some time and finally, I've discovered that one needs to have URL Authorization installed in order to make it work.
Navigate to the windows features and install the following feature:
Web Server (IIS) -> Web Server -> Security -> URL Authorization
I've also restarted IIS just in case, but I'm not sure if it's needed.

IIS 8.0 ASP.NET and Error 500.19

I can't seem to get any ASP.NET sites to run under IIS8 on Windows 8. Under IIS Express they are fine, but I've:
Installed IIS8
Installed ASP.NET 3.5 and 4.5 features in IIS
Created a valid application pool
Added a new Application in IIS manager pointing to my site
But I get:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Config Source:
-1:
0:
Any ideas?
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, under the Server name → Feature delegation.
If Handler Mappings is set to readonly and your site web.configs have a handlers section, flip the value to read/write and see what happens.
Worked for me when moving to Windows 8 / IIS 8 / ASP.Net MVC 4.
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 not CGI.
i'm using w10 technical preview
I had same issue, this is because the app pool doesn't have rights to the web site directory or web.config. Try to grant rights for "IIS_IUSRS" with : Read,Execute,List.
I had the same issue when moving a web application from IIS 7 to 8, and I solved it by installing the URL Rewrite module, which I had completely forgot. So check that you have the correct modules etc. installed on your new server/IIS.
You can install this module with WPI (Web Platform Installer) also.
If you have a new machine / formatted your machine, while installing IIS, make sure that you ticked installing ASP.Net (appropriate version).
Hint : Turn Windows Feature ON/OFF --> IIS --> Application Development Features --> ASP.Net 3.5 / 4.6
Recently I have upgraded to Windows 10 (IIS 10) & as I had forgot to install ASP.Net, I was facing this issue.
Other troubleshooting tips are:
2) Make sure you have given read permission to IIS_IUSRS group on
your application folder.
3) You may check if your Application Pool
has correct target .Net framework selected.
4) Make sure your
Web.config is proper (well defined XML) and has no errors. Thanks.
Look in the web.config for invalid config sections.
In the IIS manager I couldn't open any of the features such as Module etc.
In my web.config I had an invalid config section from a chart object that I used before:
<system.webServer>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
</system.webServer>
After I removed it everything worked.
After trying all of the above, I was still stuck, so I decided to go look at the file referenced in my error message, "c:\some\path\web.config"
It was 3KB, and I renamed it to "_web.config", and the script immediately started working properly.
I assume the original created with how things were set before my myriad changes. With all the changes I did, it could now create a proper web.config.
Something to try if the above doesn't get you where you need to be, guys.
Finally sorted mine! Jesus.
I was using git hub for my project and downloading it to slightly different locations on each PC.
When I tried to unc to the config file the error mentioned I noticed it was actually the path the other pc uses. Couldn't fine this listed in the project at all so just right clicked the project file in VS and unloaded it, the loaded it again and it now works.
You probably tried this first but have you tried turning your pc off and on again? I tried all of the above first to no avail while simply doing this worked for me. Possibly one of my previous actions locked an important file in my project.

403 forbidden after publishing asp.net MVC

I know this has been answered a few times but none of the solutions worked for me. I published my ASP.NET MVC 3 application (It was just the internet template without any changes to it) to see if I could get it to work publically. However, when I visit the site it shows up with a 403 error. Coming from a php/linux background, I'm confused and have no clue where to look. I've only been learning .NET for about 8-9 months and everything I've been testing on before was on the local development server through VS2010. It almost appears like the server doesnt know it should be an MVC application or I have to change my routing.
Anyway, I checked to make sure that the server setting is .NET 4. Any help would be greatly appreciated.
ALSO, It's a shared hosting environment using arvixe.
For me this did the trick (Original Answer by Mmerrell at Getting 404.0 error for ASP.NET MVC 3 app on IIS 7.0 / Windows Server 2008 )
You actually just reminded me that I needed to fix this issue in an
enviroment here. If your situation is the same as mine then it's a
simple fix.
Just add the following to your web config:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
Make sure your have choosen the "ASP.Net 4.0" App-Pool and not the App-Pool created for your application.
Make sure your App Pool uses the "ApplicationPoolIdentity" and NOT NetworkService. Remove the NetworkService permission from your root folder. You dont need it. IIS has an built-in identity (IIS_IUSRS).
403 is a forbidden error. Try checking the NTFS permissions of the folder where you deployed, ensure the Network Service user has read permission
Additionally, check the Authentication and Authorization mechanism in the IIS application:
Edited:
.Net Authorization rules
I had this same issue after publishing an MVC 4 WebSite to a remote server using FTP Publishing. What ended up working for me was after publishing through Visual Studio, log onto IIS on the remote server, locate the published directory -> right click -> Convert to Application.
Not sure if there is a way to specify this in the web.config/properties, if you don't have access to the server?
1- verify that your application is running under .NET 4.0 (you did so)
2- check with the hosting company that it supports the MVC 3 framework on their hosting plan.
3- (works) Bin-Deploy your MVC run-time libraries so you may overcome any requirements on the server.
More bout bin-deploy your ASP.NET MVC can be found here: http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx
4- check that "Network Service" has proper access rights to your folder. it basically should have "Read" permission.
Don't forget about aspnet_regiis.exe -ir.
<handlers>
<add name="rewrite" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>
Ask your hosting provider to add this handlers into webconfig
Try changing the Managed Pipeline Mode of the Application Pool to 'Classic' instead of 'Integrated'.
Whilst it may not be the final result that you're after (there can be real advantages in using Integrated mode), at least it will point you in the right direction... if it works.

Resources