IIS8 Win8 and runAllManagedModulesForAllRequests="true" - asp.net-mvc-3

I am attempting to run an application in IIS8 that has the following in the config:
<modules runAllManagedModulesForAllRequests="true" />
IIS8 is giving me an error that says...
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".
I'm guessing by the error and a quick SO search that there is some higher level security setting that's preventing that line from being allowed. Any ideas?

I've solved the same problem by installing the window features "Internet Information Service/World Wide Web Service/Application Development/ASP.NET x.x" in the Control Panel of Windows8. If you want to setting on Windows Server 2012, the following link gives you hint.
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
hope that it works out.

For those of you running Windows Server 2012 the Application Development features are found at
[] Server Roles
[] Web Server IIS
[] Web Server
[] Application Development
[] ASP.NET x.x
When you select the .NET version it will ask if you want to add Extensions and other features. I just said yes, but you may be able to get away without installing those.

its hard to give a specific answer here, but the basics of it are that you need to look at the machine.config for the box you're running on. find the system.webServer node and look for the 3 tags/attributes its referencing in the error. chances are you'll find something that is marked as not overridable (allowOverride="false"), but i've not messed with windows 8/server 2012 yet, so i don't know what the machine.config looks like.

You can unlock the section via the IIS UI per https://serverfault.com/a/516921/137255
Open IIS Manager
Click the server name in the tree on the left
Right hand pane, Management section, double click Configuration Editor
At the top, choose the relevant section based on the offending item's XPath; i.e. system.webServer/modules for this example.
Right hand pane, click Unlock Section

Related

User mycomputer\myloginName does not have required permissions

I am trying to access the report manager url for SSRS. But, I keep on getting the error below -
User mycomputer\myloginName does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed.
I tried to run my browser as admin as described here - User '' does not have required permissions, SSRS 2008 on Windows 8
with no success. I also don't see the 'site settings' on top-right corner as mentioned by so many people. Also, I cannot go through the pain of reinstalling SQL server all over again. I don't want to disable UAC.
I am unable to do anything because of this problem.
How do I fix this problem?
This solution is for Internet Explorer. I don't know how it can be done for firefox or chrome.
Link 1 -
http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/9b5a8763-84ce-46d0-b011-067ad39223d1/
See the solutions by Chirag Shah. Follow only up to step 13. I could not follow Step 14 because I found no home dialog box.
In the steps Chirag talks about some URL's. I don't really understand the meaning of any of those URL's. So, I used the URL under "Report Manager URL" in "Reporting Services Configuration Manager". It was
http://localhost:8080/MyReportServer.
The 8080 is a port number.
Once you finished this, go to the link below and follow all the steps -
http://www.soheib.com/technical-knowledge/sql-server-2012-reporting-services-uac-user-access-control/
In the 7th step, I saw a lot of check boxes. I selected all of them.
Finally, I can rest in peace. Hope it works for you too.
Also, when making the accounts described in the above link, you might see "BUILTIN\Administrators" account. Ignore it - thats what i did.
**END OF POST**
Steps taken from Chirag Shah's post -
Configure the report server for local administration. To access the report server and Report Manager locally, follow these steps:
Start Windows Internet Explorer.
On the Tools menu, click Internet Options.
Click Security.
Click Trusted Sites.
Click Sites.
Under Add this Web site to the zone, type http://ServerName. If you are not using HTTPS for the default site, click to clear the Require server certification (https:) for all sites in this zone check box.
Click Add.
Repeat step 7f and step 7g to add the http localhost URL, and then click Close.
Note This step enables you to start Internet Explorer and open either the localhost or the network computer name of the server for both the Report Server application and the Report Manager application.
Create role assignments that explicitly grant you access together with full permissions. To do this, follow these steps:
Start Internet Explorer together with the Run as administrator option. To do this, click Start, click All Programs, right-click Internet Explorer, and then click Run as administrator.
Open Report Manager. By default, the Report Manager URL is http://ServerName/reports. If you use SQL Server Express with Advanced Services SP2, the Report Manager URL is http://ServerName/reports$sqlexpress. If you use a named instance of Reporting Services, the Report Manager URL is http://ServerName/reports$InstanceName
i was receiving blank page after i was logging exactly 3 times on my report server URL.
i've Turn Off Internet Explorer Enhanced Security. On different OS's it is in different location. find the location and turn it off.
I hope this will help you.

IIS restriction error for .aspx page, but .aspx is not restricted

I have recently tried to install TargetProcess http://www.targetprocess.com/ on my windows machine, which involves installing IIS and an instance of SQLEXPRESS.
I have no previous with IIS so most to the concepts where new to me. After much head scratching and tinkering I managed to get TargetProcess to install. However when I try to run it in a browser I get teh following error
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.
The page I am trying to run is .aspx and I have run a page.aspx to verify that .aspx are not being restricted as suggested by the error message.
Anyone got any ideas as to what else it could be?
Kevin,
In the IIS management console, please open ISAPI and CGI Restrictions feature fro your hosting server. ASP.NET v2.0 and v4.0 restrictions are set separately. TargetProcess application is using .NET v4.0 since 2.22.9 build, so please check, that MS .NET framework v4.0 is installed and ASP.NET v4.0 is allowed. Also on the Handler Mappings section for TP web site PageHandlerFactory-ISAPI-4.0 should be enabled.
Please contact us via http://messenger.providesupport.com/messenger/targetprocess.html if you need any assistance.
Regards, Alex - TargetPro
To solve:
1.- Go to IIS manager and clic on your server name (when tooltip says localhosts)
2.- double clic on ASAPI and CGI restriction
3.- right clic to change all items to ALLOWED
The "ISAPI and CGI Restrictions" option was not there on my machine. I had to go back into the "Turn windows features on and off", then the "Internet Information Services" / "World Wide Web Services" / "Application Development Features" and then ticked the "CGI" option. Once I did this, the "ISAPI and CGI Restrictions" option appeared after I closed and re-opened IIS. Just mentioning it here in case anyone else has the same problem.

Unable to start program 'http://localhost/Default.aspx'. VS2010

I cannot start my website from Visual Studio 2010 anymore.
For a few days I cannot start my project in a web browser using F5. When I open my web application directly by typing the same url 'http://localhost/Default.aspx' everthing works fine.
When I run the project (F5) a new webbrowser starts, but after a few seconds it is stuck and Visual Studio gives an error dialog:
Microsoft Visual Studio
Unable to start program 'http://localhost/Default.aspx'.
OK
When I run the project in release mode it gives an extra error:
Microsoft Visual Studio
The following module was built either with optimizations enabled or without debug information:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6552bec6\694bce32\assembly\dl3\8c9bd8d8\fb1d75cb_af26cc01\[name].Presentation.DLL
To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.
OK
I have already repaired, removed and reinstalled Visual Studio 2010, I've tried using different browsers (including Chrome and Firefox), used different aspnet_regiis.exe options, etc. etc.
Nothing helps, and yeah now I'm stuck pulling hair out of my head ...
Anyone any idea how to solve this?
Does it work if you start it with [CTRL]+[F5] which runs without the debugger?
If so, then you have an issue with the debugger auto-attaching to the web server. I would check that debugging is enabled for your web project - a warning that usually crops up automatically from VS when it detects that a project is not built in Debug mode.
This is not as simple as switching the project configuration over to Release, because the DLL that the debugger is moaning about is one of the dynamically generated ones originated by Asp.Net itself.
Typically you should have, in your web.config:
<configuration>
<system.web>
<compilation debug="true" >
</compilation
<system.web>
<configuration>
(Along with any other stuff in <configuration> and <system.web> nodes).
There's also the possibility that Asp.Net debugging is not, for some reason, enabled.
Check out this msdn article on debugging asp.net applications in VS2010 for more information.
Note that if this is VS010 express, then you won't be able to debug - as confirmed by the aforementioned link; but since you way it used to work then I guess that's not your problem.
Update
Since that hasn't worked - you can try emptying the Temporary ASP.Net files folder. Easiest first is to do an iisreset. Then navigate to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files and delete everything in it. I've had issues in the past where the Asp.Net binaries don't get refreshed and so when I'm debugging it moans that the files are out of date.
Change the View Browser to another browser. Run the view in browser or debug, then change back to original browser should work after that.
Had same problem, answer for me was to remove Avast Free AV. Everything worked for a year with avast free up until a week or so ago, uninstalling it fixed the problem.
I had this exact problem with Visual Studio 2008. The solution was to set the default web browser that VS uses to a real browser (e.g. IE) and not the "Internal Web Browser".
Right click on an ASPX file in your project and select "Browser With...". This lets you select the default browser to use when you select the "View in Browser" option and for when you debug/run the app (this is key).
Select your favourite browser (i.e "Internet Explorer") and click on "Set as Default". Do not pick "Internal Web Browser".
Debug away! Your app should come up in your browser now and debug as normal.
the solutions for me is to test with 127.0.0.1 in place of localhost. and all goes well for.
so the problem come from the host resolution name, to solve it please proceed like :
open cmd and then tape : %systemroot%\System32\drivers\etc\
open hosts file with notepad and the look for localhost ligne(you'll find 0.0.0.0 befor it )
change the 0.0.0.0 with 127.0.0.1 at all lignes with localhost .
I solved in this way:
Right click on a aspx page
Browse with set internal browser as default
Remove the previous default browser
Add %programfiles(x86)%\internet Explorer\iexplore.exe
Set this choice as default
For me I just did a Build /ReBuild on the project level and it started working!!!
I had the same problem. When I debug my code it says:
Unable to start program 'C:\homework.exe'. this system cannot find the file specified."
I'm using Microsoft Visual C++ 2010 Express but when I made a new project by the following steps:
Open C++:
Press new project
Press win32
Press win32 Console Application
Rename it
Click next
make sure: that the application type is console application
additional options: empty project*
Press Ctrl+Shift+A
In Visual C++/Code section press C++ File (.cpp)
rename it and press add
It works fine with for me now.
Please set your page name e.g Default.aspx revert to parent in IIS configuration
I'll share my experience with this same problem. This is not a solution, but someone may be able to figure out the problem from my particular experience.
I've been having this same problem for a few weeks now. (I don't know what changed on my system.) I do not run as local admin, because we are not allowed to have admin privileges on our PCs where I work.
Until today, I could expect F5 (Start Debugging) to start up a new local VS web server, open an IE window, and then issue an "unable to start program http://localhost:nnnn/Login.aspx" and "access is denied" error pop-up. If I closed the IE window, waited a few seconds, and then clicked F5 again, it usually started up my web app in debug mode just fine from that point on.
But today, that all changed. I did not change any configuration on my web app, which has been running fine, but I did add a couple of more classes to one of my subprojects. At this point, I could never get past the "unable to start program" message. I could run my app without debugging, but that was rather pointless. I even tried attaching to a running (non-debug) IE process, but that did not work.
Finally, I modified some of the properties in the WebAppName >Web >Servers screen. Specifically, I enabled "Specific port" for a specific HTTP port (which VS had been using all along), and I disabled "NTLM Authentication". I also enabled "ASP.NET" in the Debuggers section. Some of these I first clicked, then unclicked, then clicked again, saving in between each click.
This time, running with debug (F5) worked.
After running several times, I still usually get a "unable to start" error the first time after a recompile, but I can still usually get a debuggable running app to start after the second or third try. At least I'm back to where I was yesterday.
I suspect it has do with VS reloading its execution profile, and also probably something to do with permissions (since I cannot run as admin).
I'm using VS2012 with an ASP.net app that was written using VS2003... I've tried everything to get the IE page to open automatically when I select F5, or even Ctrl+F5... Haven't been able to get anything to work... However, I have stumbled upon a very poor work-around. When I select debug and I get the 'Unable to start program...' msgbox... I noticed that on the icon-tray I get a msg saying local-host has started
You'll notice a picture that the msgbox is pointing to:
Well, if you right click it, you get three options:
When you select the first: 'Open in Web Browser', it will open IE with the page your working with...
Like I said, it's a very poor work-around... but it works. This isn't an issue when I select debug using 'Chrome' or the page-inspector... But they have their own issues.
Try to turn on Bypass proxy for local addresses.
First you can go to your browser settings-> Change proxy Settings-> Connection-> Lan Setting and just check bypass proxy for local addresses.
If this solution don't work then also copy the following code check your web.config file for settings to bypass firewall:
<system.net>
<defaultProxy>
<proxy usesystemdefault="true" proxyaddress="http://proxy:port" bypassonlocal="false" />
</defaultProxy>
</system.net>
I easily resolved this problem by enabling script debugging in the browser.
When I ran into this problem (using IE 11) I noticed that iexplore was open about a hundred times in the task manager. After killing them all I was able to open my project just fine.
Since then, I have made a .bat file with this code:
taskkill /F /IM iexplore.exe /T
so now I just run the .bat when I get that error.
(alternatively you could run that code from the cmd)
I just ran into this problem in Visual Studio 2013. I had to enable Anonymous Authentication.
Click on the project node in solution explorer.
Hit F4 to show the properties window.
Change the Anonymous Authentication option to Enabled.

What is overriding Windows proxy settings (inserting "vsts-proxy-installed-indicator") and how do I turn it off?

I have a number of machines, all of which have Visual Studio installed, where something (presumably visual studio) is overriding the proxy settings: setting up localhost and some random port for both HTTP and HTTPS. In the "Do not use proxy server" box, it puts <vsts-proxy-installed-indicator> which is presumably a tag so it know it's done it.
This occasionally prevents browsers from working on my desktop, and more recently, changed it on our build server which caused the code signing step (which connects to an external timestamp server) to fail all day until I finally found this proxy issue.
What is changing these settings? Why is it changing them? How do I turn it off?
Note, there is a serverfault question about this as well: What is inserting “vsts-proxy-installed-indicator”? but since this is a Visual Studio-specific question, I thought it might be better to ask here.
This happens because you've enabled "ASP.NET Client Proxy for IntelliTrace and Test Impact" in the Test Settings.
To disable - VS2010: Open the menu Test > Edit Test Settings > (select the current active test settings), select Data and Diagnostics and disable the mentioned setting.
To disable - VS2013: Double click on the enabled* .testsettings-file in the solutions explorer, select Data and Diagnostics and disable the mentioned setting.
*) You'll find which one is enabled (if any) under TEST> Test settings
Keep <vsts-proxy-installed-indicator> in the exception list along with the other proxy and exception settings. This will solve the issue.
It looks like running mstests (e.g., from the "Test List Editor" tab triggers this! Can someone reproduce?

HttpContext.Current.User.Identity.Name is Empty

I have a Silverlight application (using MVC) and when i'm building in visual studio, using Visual Studio Development center, there's no problem, the HttpContext.Current.User.Identity.Name has a Value
But when i'm using the same project with IIS 7.5 (i'm using Windows 7), HttpContext.Current.User.Identity.Name stays empty
Anyone who can help? Or knows where i can find the settings from the visual studio Development center, so i can check what's wrong in IIS?
I struggled with this problem the past few days.
I suggest reading Scott Guthrie's blog post Recipe: Enabling Windows Authentication within an Intranet ASP.NET Web application
For me the problem was that although I had Windows Authentication enabled in IIS and I had <authentication mode="Windows" /> in the <system.web> section of web.config, I was not preventing anonymous access. This last part was the key. You need to prevent anonymous access to ensure that the browser sends the credentials.
You can either configure IIS in Control Panel so that your site (or machine) uses Windows authentication and denies anonymous access or you can add the following to your web.config in the system.web section:
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
</authorization>
These might resolve the issue(It did for me). In IIS Express change the project property values, "Anonymous Authentication" and "Windows Authentication". To do this, when project is selected, press F4 and then change these properties.
In case you are deploying it on IIS locally, make sure local machines "Windows Authentication" feature is enabled and "Anonymous Authentication" is disabled.
Refer to
https://grekai.wordpress.com/2011/03/31/httpcontext-current-user-identity-name-is-empty/
In addition to "answered Mar 28 '11 at 12:27Bryan Bedard"
In case that the solution doesn't work, you have to enable Windows Authentication in iss manager.
How to do that:
1.To start IIS Manager from the Run dialog box:
On the Start menu, click All Programs, click Accessories, and then click Run.
In the Open box, type inetmgr and then click OK.
2.In the Connections pane, expand the server name, expand Sites, and go to the level in the hierarchy pane that you want to configure, and then click the Web site or Web application.
3. Scroll to the IIS section in the Home pane, and then double-click Authentication.
4.In the Authentication pane, select Anonymous Authentication, and then click Disable.
In the Authentication pane, select Windows Authentication, and then click Enable.
Reference
Disabling all other options in authentication tab of iis except windows authentication resolved my issue.
Please check..
Steps:
Open iis in your machine
Select your application from the application pool
Click on authentication option
Disable all other option except windows authentication (Anonimous authentication should be disabled)
Please check this and let me know the feedback. It worked for me. hope it will work for you also..
I also had this problem recently. Working with a new client, trying to get a an old web forms app running from Visual Studio, with IISExpress using Windows Authentication.
For me, the web.config was correctly configured
However, the IISExpress.config settings file had:
<windowsAuthentication enabled="false">
The user account the developer was logged in was very new, so unlikely it had been edited.
Simple fix it turned out, change this to enabled=true and it all ran as it should then.
Also, especially if you are a developer, make sure that you are in fact connecting to the IIS server and not to the IIS Express that comes with Visual Studio. If you are debugging a project, it's just as easy if not easier sometimes to think you are connected to IIS when you in fact aren't.
Even if you've enabled Windows Authentication and disabled Anonymous Authentication on IIS, this won't make any difference to your Visual Studio simulation.
The browser will only detect your username if the IIS server is on the same domain and the security settings within your group policy allow it.
Otherwise you will have to provide it with credentials, but if it is not on the same domain, it will not be able to authenticate you.
Apart from all obvious reasons mentioned earlier, there might be another one: you didn't put an Authorize attribute on top of your controller, like that:
[Authorize(Roles = "myRole")]
[EnableCors(origins: "http://localhost:8080", headers: "*", methods: "*", SupportsCredentials = true)]
public class MyController : ApiController
At least that's what worked for me.
As #PaulTheCyclist says, If using IISExpress anonymous authentication is enabled by default, windows authentication is disabled.
This can be changed in what I'm sure used to be called PropertyPages (NOT right-click -> properties). Select the web project
Try enabling basic authentication and disabling the other authentications in IIS, then try launching the application. The application will ask for windows credentials. Enter the same and the app should be able to get the name under HttpContext.Current.User.Identity.Name.
I was facing this issue when authentication mode was not set while creating the project.
So It worked when created a new project with authentication set to windows mode in the initial settings.

Resources