现在的位置: 首页 > 综合 > 正文

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

2012年06月12日 ⁄ 综合 ⁄ 共 2481字 ⁄ 字号 评论关闭

    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

 

    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:

 

l         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)

l         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.

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

<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"/>

 

l         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.

抱歉!评论已关闭.