Click here to Skip to main content
Licence 
First Posted 10 Aug 2005
Views 18,817
Bookmarked 25 times

How to debug ASP.Net program without the privilege of administrator

By | 10 Aug 2005 | Article
If we don’t have the administrator privilege, we can’t debug or even create a web application. And we can’t manage the IIS also. It is really a problem for all the asp.net developers. You may encounter the errors just like that "Can't dubug,.....Access Denied."

Introduction

In many companies, just like mine, the security policy said that anyone can’t have the administrator privilege on his own computer, especially to developers, because they know very much about the system. In potential, they could do badly to the computer and the whole company. Really? Just a joke I thinkJ

 

The Content

    As for asp.net developers or so called programmers, we are assigned the VS Developers and Debugger Users privileges, even the power user privilege is forbidden. It is easy to know that if we don’t have the administrator privilege, we can’t debug or even create a web application. And we can’t manage the IIS also. It is really a problem for all the asp.net developers. You may encounter the errors just like that "Can't dubug,.....Access Denied."


    But don’t worry. With the help of MSDN and many times of restarting my computer, I find the solution. I don’t know it is a piece of good news or bad news to developers and senior management. Whatever it is, only from the technical viewpoint, I share the solution to all of you:

 

 Firstly, please give the write privileges on these folders if the file system is NTFS. Other else, you can write files on the disk even it is C Disk.

C:\WINDOWS\Microsoft.NET and C:\Program Files\Microsoft Visual Studio .NET 2003. (for VS.Net 2003)

 

Secondly, please modify the machine.config.

(C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config). In this file, you can find a section named processModel, and change the usename, password as the following.

<processModel enable="true" timeout="Infinite" idleTimeout="Infinite" 

   shutdownTimeout="0:00:05" requestLimit="Infinite" requestQueueLimit="5000" 

restartQueueLimit="10" memoryLimit="60" webGarden="false" cpuMask="0xffffffff" 

userName="DomainName\Koffer" password="Abcd12345678" logLevel="Errors" 

clientConnectedCheck="0:00:05" comAuthenticationLevel="Connect" 

comImpersonationLevel="Impersonate" responseDeadlockInterval="00:03:00" 

maxWorkerThreads="20" maxIoThreads="20"/>

 One thing needs to mention: the password is in plain text, and it seems to be insecurity. But it doesn’t matter.

 

 Finally, restart your computer and you will find you can create web application and debug the application successfully.

 

    Till now we solve most of the problems. But when you try to open the IIS, you will find nothing in it. It is also a big problem to us. Here we create a batch file to open this using the administrator privilege. So the administrator should input the password once only. The most important thing is the content of the batch file.

Here it is:  runas /savecred /user:administrator "mmc compmgmt.msc"

Please copy and save it to a batch file, such as OpenIIS.bat. Yes, only one sentence, it is so simple.

And now you will find you can manage the IIS just as you have the administrator privilege.

 

Enjoy the journey and programming.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

koffer

Web Developer

United States United States

Member

I am a brave developer of asp.net,c#!
I have worked more than 3 years!
 
I don't love coffee,but I like to drink milk and tea!
 
I am in ShangHai,China

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 10 Aug 2005
Article Copyright 2005 by koffer
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid