How to use ASP.NET Web Site Administration Tool ( WSAT ) on Production Server

Posted: July 4, 2010 in Development, SharePoint
Tags: ,

You know that there is an ASP.Net Configuration section in VS 2005 or 2008  Website menu. By clicking this, an ASP.NET web site administration tool opens and you can configure your providers and create users and roles. In the development environment it’s easy to use because you simply click on Website and Asp.Net Configuration.

BUT in the production server you may not want to install visual studio . so how can you use this tool ?

  1. In the server where you have VS 2005 installed, from VS create a new simple web site which you want to Administer. It can be a simple web site, the main idea is that we want to use WSAT to create user in the production server.
  2. I am using File System to create the website and have called it CreateSQLUsers . ( Location : C:\Inetpub\wwwroot\CreateSQLUsers )
  3. Click on the ASP.NET Configuration button in your Solution Explorer’s toolbox or Website menu.
    We will need the URL soon (in my case, it is… http://localhost:1347/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=C:\Inetpub\wwwroot\CreateSQLUsers\&applicationUrl=/CreateSQLUsers)
  4. Copy the contents of created web site to a folder in production server. ( I used the same path both in development and production server as C:\Inetpub\wwwroot\CreateSQLUser )
  5. Now, go to your production server, Open IIS console.
  6. Right Click on Web Sites -> New -> Web Site . Create a new web site and point it to the location where your website files is copied. ( C:\Inetpub\wwwroot\CreateSQLUser ) in my case site name is : SimpleSite on port : 200
  7. Right-Click on your Web Site and New -> Virtual Directory, Click on Next, give an Alias (WebSiteAdmin) and click Next
    In the Directory text box browse to… “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles” and click Next, Next and Finish.
  8. Right-click on WebSiteAdmin and hit properties, Click on the “ASP.NET” Tab and check ASP.NET Version as 2.0.50727 and click Ok.
  9. Right-Click on WebSiteAdmin and hit properties. In the “Virtual Directory” Tab if in the “Application name” section there’s no application, Click Create.
  10. Open an instance of Internet Explorer and in the Address Bar Paste the URL from the development environment… and do some changes like this :
    http://SimpleSite:200/WebSiteAdmin/default.aspx?applicationPhysicalPath=C:\Inetpub\wwwroot\CreateSQLUsers\&applicationUrl=/CreateSQLUsers
  11. 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)

As you can see, we have changed the site name and port number and changed asp.netwebadminfiles to our application WebSiteAdmin.

***

NOTE :

If you encounter this error :

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

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

Here is reason and how to resolve :

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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\. Then look for App_Code\WebAdminPage.cs. This much we know from the error.

On line 344 or 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, “SimpleSite“); This works as a charm!!

***

The above solution was found here . also Thanks to Magician comment.

Advertisements
Comments
  1. Minh says:

    What’s the solution when i must create SimpleSite as Virtual Directory? In this case, the url: http://localhost/SimpleSite/WebSiteAdmin/default.aspx?applicationPhysicalPath=C:\Inetpub\wwwroot\CreateSQLUsers\&applicationUrl=/CreateSQLUsers??

    • Juan Esteban Garcia Osorio says:

      your application must be a website and not a project asp.net and you probably have just copied the application manually, to correct the problem you have to publish the site by Visual studio “publish web site” and then everything will be ok, another way to use Wsat in production is creating independenly 1) run aspnet_regsql to configure the databasese, 2) create a website and copy the ASP.NETWebAdminFiles related to the framework you are using and the machine x86 or x64, , 3) update the web config in the new site: membership tag, roleManager tag to be configured to use your new dababase, load the default.aspx with the parameters specified in this blog applicationPhysicalPath and applicationUrl to point out the site your going to applied the security role, memebership, etc. …. and that’s all, !!!!! you can create de wsat site as and independent site or as an application of the main site, if you create the sites independenly, you have to apply the publishing process to both sites.

  2. I absolutely love your blog and find a lot of your post’s to be just what I’m looking for.

    Does one offer guest writers to write content in your case?

    I wouldn’t mind producing a post or elaborating on a lot of the subjects you write regarding here. Again, awesome website!

  3. Steven says:

    Thank you very much for this article!

    Best regards,
    Steven

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s