How to use Web Site Administration Tool without installing VS 2005


Hello everyone!! This one is a tweak to ensure that you are able to Administer your ASP.NET 2.0 web-site *without* installing Visual Studio 2005 on your IIS Server.


For that, you would need Framework 2.0 installed on your Server. If you don’t have it, please install it from http://msdn.microsoft.com/netframework/downloads/updates/default.aspx.


Now, follow the instructions below…


1) In the box where you have VS 2005 installed, open an application which you want to Administer.
2) I am using File System to open the website and have called it WebSiteAdminister
3) Click on the ASP.NET Configuration button in your Solution Explorer’s toolbox
4) Copy the URL (in my case, it is… http://localhost:2002/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=C:\Inetpub\wwwroot\WebSiteAdminister\&applicationUrl=/WebSiteAdminister)
5) Now, go to the IIS Box where you don’t have VS 2005 installed
6) Open IIS console (Click on Start -> Run, type Inetmgr and click OK)
7) Right-Click on your Default Web Site and say New -> Virtual Directory
8) Click on Next, give an Alias (WebSiteAdmin) and click Next
9) In the Directory text box browse to… “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles” and click Next, Next and Finish
10) Right-click on WebSiteAdmin and hit properties
11) Click on the ASP.NET Tab and select 2.0.50727 as ASP.NET Version and click Ok
12) Copy the content of the website from the Development box to the IIS Server (I did it at “c:\inetpub\wwwroot\WebSiteAdminister”)
13) Open an instance of Internet Explorer and in the Address Bar type… http://localhost/WebSiteAdmin/default.aspx?applicationPhysicalPath=C:\Inetpub\wwwroot\WebSiteAdminister\&applicationUrl=/WebSiteAdminister
14) You should be able to see ASP.NET Web Site Administration Tool (You can bookmark this so that you don’t have to remember that string)
15) As you can see, we have removed the port number (2002) and changed asp.netwebadminfiles to our application WebSiteAdmin.


By the way, just to bring it to your notice, Administering you web site using the above technique is NOT supported at Microsoft. For support options at Microsoft, please visit… http://www.microsoft.com/services/microsoftservices/srv_support.mspx


Hope that helps!!

Comments (30)

  1. Trackback from dotnetkicks.com

  2. Stephen Vitoria says:

    Excellent. It actually works. Well done.

  3. Jurka Rahikkala says:

    Hi,

    I got the following error, any ideas why?

    The following message may help in diagnosing the problem: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: site at System.Web.Configuration.WebConfigurationHost.InitForConfiguration(String& locationSubPath, String& configPath, String& locationConfigPath, IInternalConfigRoot configRoot, Object[] hostInitConfigurationParams) at System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site, String locationSubPath, String server, String userName, String password, IntPtr tokenHandle) at System.Web.Configuration.WebConfigurationManager.OpenWebConfigurationImpl(WebLevel webLevel, ConfigurationFileMap fileMap, String path, String site, String locationSubPath, String server, String userName, String password, IntPtr userToken) at System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfiguration(WebConfigurationFileMap fileMap, String path) at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, String appPhysPath, Boolean getWebConfigForSubDir) in c:InetpubWebSiteAdministerApp_CodeWebAdminPage.cs:line 345 at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, Boolean getWebConfigForSubDir) in c:InetpubWebSiteAdministerApp_CodeWebAdminPage.cs:line 325 at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path) in c:InetpubWebSiteAdministerApp_CodeWebAdminPage.cs:line 320 at System.Web.Administration.WebAdminPage.VerifyAppValid() in c:InetpubWebSiteAdministerApp_CodeWebAdminPage.cs:line 446

  4. kbrunet says:

    How to use Web Site Administration Tool without installing VS 2005 –

    Rahul,

    I have created the Web Site Adminitrations directory and IIS configuations. I have selected

    http://10.0.0.6/UCTInternal/webstieadmin/default.aspx?applicationPhysicalPath=C:Inetpubwwwroottracker&applicationUrl=/UCTInternal/trackit

    http://10.0.0.6/UCTInternal/trackit

    and get this message. Could you help????

    An error was encountered. Please return to the previous page and try again.

    The following message may help in diagnosing the problem: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: site at System.Web.Configuration.WebConfigurationHost.InitForConfiguration(String& locationSubPath, String& configPath, String& locationConfigPath, IInternalConfigRoot configRoot, Object[] hostInitConfigurationParams) at System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site, String locationSubPath, String server, String userName, String password, IntPtr tokenHandle) at System.Web.Configuration.WebConfigurationManager.OpenWebConfigurationImpl(WebLevel webLevel, ConfigurationFileMap fileMap, String path, String site, String locationSubPath, String server, String userName, String password, IntPtr userToken) at System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfiguration(WebConfigurationFileMap fileMap, String path) at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, String appPhysPath, Boolean getWebConfigForSubDir) at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, Boolean getWebConfigForSubDir) at System.Web.Administration.WebAdminPage.VerifyAppValid()

  5. rape stories says:

    Your article is prety nice. It’s a pity that i didn’t see it more later.

  6. Kurt says:

    It still doesn’t work for http://www.website.com/WebSiteAdminister/default.aspx?……

    You get the errors described above.. but it does work if you use http://webserver/WebSiteAdminister/default….  so how can you get the web admin tool to work from out side of the network..?

  7. rahulso says:

    Well, as far as I know, you can’t get it working from outside of the Network, because Integrated Windows Authentication is required and it is not supported in the Internet mode.

  8. rosdi says:

    hi thanks for the tip!

    I installed .NET2 in IIS 5 (Win 2000) and your tip work flawlessly!

    tq very much!

  9. sriramcs says:

    Hi,

    I followed the above instructions and could not get mine to work.

    Preface on my app: My ASP.Net 2.0 application’s name is AAA MASP. It is already installed on IIS under the virtual directory ‘AAA MASP’ and it’s default page is login.aspx. So, ‘http://localhost/AAA MASP/login.aspx’ brings up the starting page right and my app works great, no problem there.

    My asp.net membership objects have been created inside the same SQL database hosting my application data using the aspnet_regsql.exe utility.

    This is the URL that comes up on my laptop when I launch ASP.Net 2.0 configuration from my application:

    http://localhost:2104/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=C:Documents%20and%20SettingsAdministratorMy%20DocumentsVisual%20Studio%202005WebSitesAAA%20MASP&applicationUrl=/AAA%20MASP

    I performed the following steps:

    i) I created the virtual directory WebSiteAdmin on the default website

    with the directory pointing to ‘C:WindowsMicrosoft .NetFrameworkv2.0.50727ASP.NETWebAdminFiles’

    ii) I chose it to use ASP.Net 2.0 version (do I change the default page to default.aspx?)

    iii) I copied the contents of ‘C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesAAA MASP’ on my laptop to ‘C:inetpubwwwrootWebSiteAdmin’ on server

    iv) I launched http://localhost/WebSiteAdmin/default.aspx?applicationPhysicalPath=C:InetpubwwwrootWebSiteAdmin&applicationUrl=/WebSiteAdmin on the server, it keeps giving me the message ‘Resource Not Found’

    What am I doing wrong? I am a newbie to IIS management beyond a basic level, just FYI. Please advise.

  10. Jurka Rahikkala and kbrunet  are having the same problem.

    Rahul’s instrucitons 1-4 are bad.

    in the querystring of the URL to the websiteadmin tool, the applicationPhysicalPath parameter must be set to the path of your website on the server, and applicaitonURL parameter must be set to the relative http path of your application.

  11. Magician says:

    If anyone is still having problems with the following error:

    System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: site at System.Web.Configuration.WebConfigurationHost.InitForConfiguration

    I have something to assist you!!

    Was stuck with this for a couple of weeks unable to get the tool running on the production server, so what I know now follows.

    The page responsible for opening the web.config file of the ASP.NET web application you specify is located in your ASP.NETWebAdminFiles folder, i.e. C:WINDOWSMicrosoft.NETFrameworkv2.0.50727ASP.NETWebAdminFiles. Then look for App_CodeWebAdminPage.cs. This much we know from the error.

    On line 345 it is trying to open the configuration according to the application path you have specified in the querystring: return WebConfigurationManager.OpenMappedWebConfiguration(fileMap, path); However, this OpenMappedWebConfiguration method has two more optional parameters, the first of which is SITE – the one we are getting the error about. So I added a third parameter to this function: return WebConfigurationManager.OpenMappedWebConfiguration(fileMap, path, "Default Web Site"); This works as a charm!!

    I am still wondering what is being used by default as this "site" parameter as it works and most machines and I have only had this problem on the production server – have not found any documentation about this. But at least there is a workaround now if anyone’s still stuck with this!!

    Best of luck with your programming.

  12. Thanks everyone for chipping in!!

  13. coolwater says:

    i had this problem.

    error message: an error was encountered. please return to the previous page and try again.

    cause of the problem.

    1. i had illegal characters on my website path.

    2. the directory of my website is too deep.

    solution:

    1. renamed my website path. (no illegal characters)

    2. changed my path to drive c:mywebsite (directory not too deep).

    when i ran the web administration tool again after the changes it worked fine. I really don’t know if the illegal characters or deep directories was the cause of the error. as far as i know after the changes the tool worked. i hope this will help.

    good luck

  14. Thank you so much, this saved me a lot of time. Once I figured out that I had to setup the security providers from the IIS Asp.Net tab (Edit Configuration), then the whole tool actually started to work.

  15. John says:

    One other possible solution:

    For debug purposes, I set my web project to output to an IIS site as opposed to the default debug web site. This broke the Web Site Administration Tool. Once I reverted my project back to the default debug behavior, the problem was resolved.

    At some point, I will publish the site to a more static model, but for development purposes, the above fix worked for me.

  16. wowpicker says:

    Excellent work!

    Great thanks to Magician

  17. chenxizhang says:

    good work!

  18. Terry says:

    Getting this error when I click on the WSAT security tab:

    Could not load type ‘System.Web.Administration.WebAdminModule’.

    The error is coming from web.config:

    <httpModules>

       <add name="WebAdminModule" type="System.Web.Administration.WebAdminModule"/>

    </httpModules>

    Any thoughts?

  19. Hi Terry,

    I haven’t seen this error before. Although, I would like to know if you are running this application under 2.0? Did you check that?

    Also, can you share the complete error message that you get in your browser?

  20. Problim says:

    The resource cannot be found.

    whate we must be do

  21. sanjib roy says:

    sir irspect you. sir BOWMER&KIRKLAND company, adress of 1050 HIGH EDGE COURT,HEAGE,BELPER,DERBYSHIRE, and UK IMMIGRATION SERVICES,adrss of 130 SHAFTESBURY AVENUE.LONDON.WID 5EU.  this two adress and company parfect? massege me please

  22. myang says:

    Magician’s solution works. Thank so much magician 🙂

  23. Gerardo says:

    When I try to view the webSiteAdmin Site i get an Access Denied error. I know that it’s some about my permission politics but i don’t know how to resolve it. help please…

  24. AK says:

    Your suggestion of adding a third parameter to return WebConfigurationManager.OpenMappedWebConfiguration(fileMap, path, "Default Web Site"); worked great but it seems you can add any random string and it still works. The problem I am having is that when I try to manage rules under security, I only see the application folder but no subfolders. I have 6 folders but they don’t show up.

    Any ideas?

  25. John says:

    Thank you so much for providing this insight. This is great! I have one issue that I hope you can help resolve.

    Everything seems to work perfectly except for when I choose to Create a New User. When I do, I get the following error:

    An error was encountered. Please return to the previous page and try again.

    Do you have any idea why this is happening?

  26. Chris says:

    It seems the third option doesn’t do anything but is required for using the OpenMappedWebConfiguration method.  Sounds like a bug….  ugh

  27. Vinod says:

    This tip was awesome. It really helped.. Awesome Stuff

  28. DRL says:

    Mike Richards is on the case, although I would say Rahulso’s instructions are not so much bad as not totally clear, but Mike Richards clears that up. I would just add that by changing the applicationPhysicalPath parameter, in the querystring of the URL to the websiteadmin tool, and the &applicationURL, to any web app for the server you can also administer them. Well it works for me on IIS 7

    (NB in IIS Manager, for IIS 7, change the application pool to ‘Classic .NET AppPool’, Terry, this is your problem, I think.)

  29. Priya says:

    Awesome!!!

    This article was very helpful!

    I was breaking my head as to how I would manage security roles and user maintenance once the application was in production.

    This solves the problem without having to write code to User Maintenance.