Search code examples
visual-studio-2022asp.net-membershipwsat

WSAT with Visual Studio 2022 or alternative


I am trying to practice a bit in ASP.NET authentication , i want to learn the Membership API first , than move to Identity.

In the older versions of Visual Studio there was a tool called WSAT (Web Site Administration Tool) to manage the security data in the database.

However , as i have Visual Studio 2022 this tool seems to be deprecated, now first what is the proper alternative to WSAT in visual studio 2022 if we want to work with the Memmbership API?

And second ,if there is no alternative and i am forced to work with WSAT, how can i change the connection string for WSAT to point at my production website, i can't seem to identify the connection string in the web.config,currently i'm getting an error when i visit the security tab .

Here is the error in french and my own translation to english :

Problème avec le magasin de données sélectionné. Cela peut être dû à un nom de serveur ou à des informations d'identification non valides, ou encore à une autorisation insuffisante. La fonctionnalité de gestion de rôles peut également ne pas être activée. Cliquez sur le bouton ci-dessous pour être redirigé vers une page où vous pourrez sélectionner un nouveau magasin de données.

Le message suivant peut vous aider à diagnostiquer le problème : L'accès au chemin d'accès 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8951fd0f\a707c782\hash' est refusé.

Translation into english :

Problem with the selected database .This may be due to the name of the server or to invalid identification informations, or to insufficient authorisation . role management functionality may also be disabled.Click the below button to be redirected to a page where you can select a new database.

The following message may help you to diagnose the problem : Access to the path 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8951fd0f\a707c782\hash' is denied.

PS : If i change the connection string named LocalSqlServer located in the C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machinf.config (which is not practical) this seems to work perfectly and point at my production database.

Thank you.


Solution

  • Here is the situation so far.

    As i see no other alternative i was forced to work with WSAT to manage my asp.net security informations which is deprecated , here is how i access it :

    Run the following command to start up IIS Express

     iisexpress.exe /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/ASP.NETWebAdminFiles" /port:8082 /clr:4.0 /ntlm
    

    Access the Admin Site via the following URL:

     http://localhost:8082/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=C:\[YOUR SITE PATH HERE]&applicationUrl=/
    

    I managed to bypass the first error which was a permission denied error , IIS was trying to access the folder "Temporary ASP.NET Files" ,i just managed the security tab of that folder and i added the account under which i'm running in the list of users and gave it read and write access(is it the proper way to do it?)

    Now when i hit the security tab in the WSAT the error has changed :

    Problème avec le magasin de données sélectionné. Cela peut être dû à un nom de serveur ou à des informations d'identification non valides, ou encore à une autorisation insuffisante. La fonctionnalité de gestion de rôles peut également ne pas être activée. Cliquez sur le bouton ci-dessous pour être redirigé vers une page où vous pourrez sélectionner un nouveau magasin de données.
    
    Le message suivant peut vous aider à diagnostiquer le problème : Impossible d'établir une connexion à une base de données SQL Server.
    

    I think it's a connection string error , WSAT can't contact the database , although i'm sure the connection string itself is right .

    Now i can't figure out how to point WSAT to my production database , note that when we talk about the file web.config there are two , one in my application folder,and the second in the WSAT folder ASP.NETWebAdminFiles, so which one should i edit? and which elements should i add? i tried all the proposed solutions and it dosen't work.

    Here is the connection strings in the C:\Windows......\ASP.NETWebAdminFiles\web.config (WSAT)

    <connectionStrings>
            
    <remove name="LocalSqlServer" />    
            <add name="LocalSqlServer"
    connectionString="Server=.\---------;Database=-------;User Id=--;Password=-----------;"
    providerName="System.Data.SqlClient"/>
    
        </connectionStrings>
    

    I also included the same connection string in my project's web.config but it dosen't work .

    I was thinking if nothing works , than i should learn the schema of the aspnet security database and manage it myself , still i found no good guide about it , some fields and tables are still strange to me .

    Finally , i decided to not work with WSAT , i will just use the Membership and Role Manager API to create web pages to manage my security database, i will have to create a registration page anyway for users , and after a while i can create my own WSAT . I got some informations and now i understand how the aspnet security database is structured.

    Your help was much appreciated though, thank you.