10/21/09

Deploying website to remote server

Now i need to deploy all the site to remote hosting, with all pages and all database structure.
Also i want to make some users and roles so the site can be usable.
How to do it without copying the data from local to remote the database?
There is the way:
ASP.NET Config Tool


You can set the users roles and setting on remote site with ASP.NET Config Tool.
Note:When  you want ASP.NET Config Tool to work on not default aspntedb.mdf databse
you need to configure it first - How to do it? you can read this article that explains simple and clearly all about this tool.

To doing this you need only to change the connection string of providers (Rolemanager and Membership Customuized providers in web.config )

<connectionStrings>
   
 <add name="MyConnectionString"
    connectionString="Data Source=my_server;Initial   Catalog=my_DB;User my_user;Password=my_passwd;Integrated Security=False;"
     providerName="System.Data.SqlClient" />
</connectionStrings>

<roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
       <providers>
          <add connectionStringName="MyConnectionString"
             name="CustomizedRoleProvider"
             type="System.Web.Security.SqlRoleProvider"
             applicationName="/M-survey1" 
             />
       </providers>
</roleManager>
<membership defaultProvider="CustomizedMembershipProvider" >
       <providers>
        
         <add connectionStringName="MyConnectionString"
               name="CustomizedMembershipProvider"
               requiresQuestionAndAnswer="false"
               type="System.Web.Security.SqlMembershipProvider"
               applicationName="/M-survey1"
              />
        
</providers>

Important!

After congifuring the users and members of the application
I found that the exisitnig usrs cannot logion and new registered users cannot access the role restricted areas.
after investigation I found that
the reason to this behavior was Appliction Name field somehow had different values for newly registered and for registered with aspNetConfiguration Tool users.


No comments:

Post a Comment

Getting started with docker

It is very simple to get started usig docker. All you need to do-is download the docker desktop for your system Once you get docker syste...