Debugging website on local IIS without administrative privileges - c#

I have a administrative account on my machine, but due to security reasons, I don't want to run visual studio as administrator. I have ASP.NET website, windows 10, IIS8. Is there is any way way to debug website without run pool with my credentials, or run visual studio as admin, or any other method, with insufficient privileges? I wanna tune my windows to allow me debug my application, and don't use brute force like "run as admin".
For winXP exists a this article this

As per https://msdn.microsoft.com/en-us/library/kd3se23d.aspx:
if you change the ASP.NET worker process to run under your own user account, you do not have to be an Administrator on the server that is running IIS.

I can't do it (as illustrated in my question).
Boklucius's citation is accurate, but I believe that article and the current update are misleading. I found that when running the app pool under my own credentials, I'm still unable to attach unless running Visual Studio as an admin. Lex Li observed that this was due to session isolation, and right now the evidence from my experimentation suggests he's right.

Related

Unable to start debugging on the web server. Visual Studio WITHOUT admin

I know there are a few topics similar to this but none have my main issue in mind. I don't want to run Visual Studio 2017 as Administrator. Why should we be forced to run it this way? In doing so you lose a few abilities:
ability to simply drag files to the solution explorer to add them to your project.
Cleanly stopping a debugging session by closing IE or stopping the debugging within VS (and it will close IE for you).
There may be others
For posterity the error is:
Unable to start debugging on the web server. IIS does not list
a web site that matches the launched URL.
I have already followed the advice thusly:
Start >> Control Panel >> Click Programs
Click Turn Windows features on or off.
In the User Account Control dialog box, click Continue
Expand Internet Information Services, expand Web Management Tools, and then expand IIS 6 Management Compatibility
Click to select the IIS Metabase and IIS 6 configuration compatibility check box, and then click OK.
I do not wish to use the IIS Express included with VS but the real local IIS I have installed.
This did not solve the issue. I have yet to find a solution that will allow me (us) to run Visual Studio 2017 and use local IIS without running it as administrator. Can anyone provide a solution?
I'll reference this article as similar but it doesn't resolve the base issue: Debugging website on local IIS without administrative privileges
Refer: Why run Visual Studio as "Run as Administrator"?
Its mentioned with MSDN reference that Administrator permissions are required If we need for
Debugging applications that a run under a different user account, such
as ASP.NET websites.

asp.net website working on localhost but not on IIS

I have built an asp.net website using visual studio 2012. My website contains various webforms(aspx). The purpose of my website is to monitor few processes on different machines on my network, i am gathering all the required information in code behind files (aspx.cs) using System.Management Class.
The website is working fine on visual studio development server, but when create a virtual directory on my IIS, I didn't get any errors but i am unable to fetch the information of the machines on my network. The information i am fetching include the couple of processes and their start time, The machine name, machine uptime.
When you are running the process in visual studio in debug, it's running under your username. Whereas when running on IIS, it's running as AppPoolIdentity. Check to see if the user that app pool is using has proper permissions to query processes on those machines.
go to application pool, and set your application pool to use local system account
You need to verify IIS_IUSRS & IUSR permissions for your site & other resources.
read more

Why run Visual Studio as "Run as Administrator"?

What is the difference between using Visual Studio 2012 "Run as Administrator" mode and otherwise? Why do developers prefer using VS in administrator mode? What are the advantages/privileges that one gets?
I may be naive enough to ask this one but I am just curious. Thanks.
From MSDN: User Permissions and Visual Studio
You can do nearly everything in the Visual Studio IDE as a normal
user, but, you need administrator permissions to complete the
following tasks:
Installing Visual Studio.
Upgrading from a trial edition of Visual Studio.
Installing, updating, or removing local Help content.
Developing solutions for SharePoint 2010.
Acquiring a developer license for Windows Store.
Adding classic COM controls to the Toolbox.
Installing and using add-ins that were written by using classic COM in the IDE.
Using post-build events that register a component.
Including a registration step when you build C++ projects.
Debugging applications that run with elevated permissions.
Debugging applications that a run under a different user account, such as ASP.NET websites.
Debugging in Zone for XAML Browser Applications (XBAP).
Using the emulator to debug cloud service projects for Windows Azure.
Configuring a firewall for remote debugging.
Profiling an application.
Deploying a web application to Internet Information Services (IIS) on a local computer.
Changing how you participate in the Visual Studio Customer Experience Program.
Windows Vista introduced User Account Control which means that you are running all programs as a standard user even if you are an admin. There are certain things that you in VS that requires you to be running as an admin, not a standard user. For example running Windows Azure emulators, asp.net dev server, etc.
You can run VS as a standard user but sooner or later you will run into issues.

run my Asp.Net Web application on another machine

How can I run my application on another machine, my team member wants to view the webpage in his computer. He doesn’t want to install visual studio but just wants to see the webpage in the browser.
I am using a Mac book
Publish it to a web server, or have him install IIS on his machine and set it up.. wait. That would be publishing to a web server.
In short, an ASP.NET website needs a web server to run. Usually it's IIS, but if you have Visual Studio, it uses the built-in Cassini web server. Either way, you need to have it in a web server of some kind. You can't just run it as a stand-alone program.
I haven't' done this, but I think you COULD have it running in your computer in Visual Studio and still have him see it. If you run it, you'll see that the address is in the format:
http://localhost/:[some port number]/YourWebAppName
If you have it running in Visual Studio on YOUR machine, your team member MAY be able to access it by changing "localhost" to your PC name. It's worth a shot.
Otherwise, here are a bunch of links to how to publish your site, in case you're not sure.
http://www.google.com/search?q=publishing+asp.net+web+sites&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=
Create a new virtual directory in IIS
Set the directory root to your project root folder.
allow anonymous access.
Your team member can then access it at http://yourmachinename/virtualdirectoryname
This looks like a good job for IIS express http://learn.iis.net/page.aspx/868/iis-express-overview/
For the majority of things, it's functionally equivilent to using regular IIS 7.5, with the exception that it's easier to start new websites with this. You simply use the command line to start IIS Express, point it to your physical path, set the CLR version, and the port, done!
http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
There's some instructions for how to do that.

what features or tasks in Visual Studio require administrative permissions?

There is a debate going in our department to remove local admin rights to the development workstations we use. I believe this will cause problems for the developers when trying to debug or run other tasks in Visual Studio but I can't put my finger on any one thing to support my argument.
What features or tasks require Visual Studio to run under a local admin account?
What do you think?
Visual Studio is designed to run in an environment without the need for administrative permissions. In general it does a good job at this and really only requires admin permissions when forced by the underlying operating system. Here are the few places I'm aware of that require this out of the box
Registering a COM component as a part of an F5
Debugging certain web project deployments on an IIS server
Attaching the debugger to processes running as Admin or other users
I'm sure there are a few more but these are the ones that come to mind. Note many of these can be worked around by making the scenario more limited user aware.
Development (= creation & debugging) of:
Windows services
A website in IIS (you can use the Development server, but its not the same)
Installation (MSI) packages
(Hardware-) drivers
Other system hooks
As an example of the project types mentioned in other answers, Visual Studio Tools for Windows Azure requires running VS in admin mode because the Windows Azure SDK's local dev fabric (cloud simulation environment for local debugging) runs in admin mode. This falls under the category of debugging processes that are running in admin mode.
If you aren't an administrator, you will need to be added to the Debugger Users group.
See also here.

Categories