Solved

VIsual Studio 2005 asp.net configuration

Posted on 2006-11-07
14
346 Views
Last Modified: 2012-06-27
Hi,

I am trying to use the asp.net configuration tool in visual studio 2005 but when I click the security tab,  I am unable to see the same selections and Miscrosoft shows at their site.  Could anyon etell me if there is something I  need to check on my system to make this work.  The OS i am using is windows xp pro.  I need to use it to set up roles etc. as all the examples says that is what I need to use but I keep getting the following when i click on the security tab;
I even re installed VS2005 to see if it will correct the problem but no luck.

"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Unable to connect to SQL Server database. "
0
Comment
Question by:krbnldy
  • 7
  • 7
14 Comments
 
LVL 9

Expert Comment

by:kraffay
Comment Utility
Make sure you have the following keys in your web config:
<configuration>
      <connectionStrings>
            <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>
      </connectionStrings>
<system.web>
<profile>
                  <providers>
                        <add name="AspNetSqlProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSQLServer" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Encrypted"/>
                  </providers>
</profile>
</system.web>
</configuration>

----------------------------------------------------------------------------------------------------------------------------------

This will point your membership data store to the default aspnetdb.mdf in the app_data folder.
0
 

Author Comment

by:krbnldy
Comment Utility
When I added the code on the web.congif  I get the following error.

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: The entry 'LocalSqlServer' has already been added. (C:\Inetpub\wwwroot\CustomerMaster\web.config line 14)
0
 
LVL 9

Expert Comment

by:kraffay
Comment Utility
The LocalSQLServer connection string is being added by the machine.config.  To get around this, add a remove node:

<connectionStrings>
 <remove name="LocalSQLServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>
</connectionStrings>


0
 

Author Comment

by:krbnldy
Comment Utility
I made the changes you suggested and i get the following

"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Unable to connect to SQL Server database."

I h ave never been able to access the optiions under the security tab that allow me to define roles as indicated on all the microsoft and other sites.  I am new to this and have no idea which way to proceed since I need to create a website that has roles for users.

0
 
LVL 9

Expert Comment

by:kraffay
Comment Utility
Can you post your web.config?
0
 

Author Comment

by:krbnldy
Comment Utility
here is my web.config

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

  <connectionStrings>
 <remove name="LocalSQLServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>
</connectionStrings>
  <system.web>
    <profile>
      <providers>
        <add name="AspNetSqlProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="LocalSQLServer"
             enablePasswordRetrieval="true"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             applicationName="/"
             requiresUniqueEmail="false"
             passwordFormat="Encrypted"/>
      </providers>
    </profile>

 
        <compilation debug="false" strict="false" explicit="true" />
        <pages>
            <namespaces>
                <clear />
                <add namespace="System" />
                <add namespace="System.Collections" />
                <add namespace="System.Collections.Specialized" />
                <add namespace="System.Configuration" />
                <add namespace="System.Text" />
                <add namespace="System.Text.RegularExpressions" />
                <add namespace="System.Web" />
                <add namespace="System.Web.Caching" />
                <add namespace="System.Web.SessionState" />
                <add namespace="System.Web.Security" />
                <add namespace="System.Web.Profile" />
                <add namespace="System.Web.UI" />
                <add namespace="System.Web.UI.WebControls" />
                <add namespace="System.Web.UI.WebControls.WebParts" />
                <add namespace="System.Web.UI.HtmlControls" />
            </namespaces>
        </pages>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows" />
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    </system.web>
</configuration>

0
 
LVL 9

Expert Comment

by:kraffay
Comment Utility
I was able to do the following:

1. Created a new Web Site in Visual Studio 2005
2. Pasted your web.config code
3. Clicked "Website/ASP.NET Cpnfiguration" from VS2005 menu.
4. This opened the ASP.Net Web Application Administration Site.  The Users panel had this message:

The current authentication type is Windows. User management from within this tool is therefore disabled.

5.  I changed the web.config authentication mode to forms:
    <authentication mode="Forms" >
      <forms loginUrl="login.aspx"/>
    </authentication>

6. The Users panel now shows:

Existing users: 0

7. From here on, I should be able to add roles and users.  

If you can't get this to work, create a new web site from scratch.  Without any changes, you should be able to follow the steps I did above and get security to work.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:krbnldy
Comment Utility
i tried following the above  and got the same error.   Are there permission issues I could have on my box,  I work on a LAN.  I have tried everything so I am beggining to think it is a permissions issue on my box.  Is there anything I can check.

0
 
LVL 9

Expert Comment

by:kraffay
Comment Utility
Do you have local Admin rights?
0
 

Author Comment

by:krbnldy
Comment Utility
it shows that i do
0
 
LVL 9

Expert Comment

by:kraffay
Comment Utility
Do you SQLServer 2005 or SQLServer Express installed?  And do you see a aspnetdb.mdf file in your app_data folder?
0
 

Author Comment

by:krbnldy
Comment Utility
my app_data folder does not have any files in it and No I do not have SQL server 2005 or express installed.    By the way is MS SQL server 2005 ctp the same as sql server 2005,  
MS SQL server 2005 ctp  is installed and has one tab - Configuration Tools that contains- configuration manager and SQL server surfacearea configuration.   I am not familiar with any of those.   Please let me know what i have to install, run or enable.

Thank you for your assistance.

0
 
LVL 9

Accepted Solution

by:
kraffay earned 100 total points
Comment Utility
The CTP is a beta.

I would download SQL-Server Express

http://msdn2.microsoft.com/en-us/sql/aa336346.aspx

That will create an instance of .\SQLServer database, which is what you need for security.
0
 

Author Comment

by:krbnldy
Comment Utility
Thank you,

I downloaded sql server 2005 express and now it works fine.  Your help is greatly appreciated.   Now let me work and making my first authenticated user website.  Wish me luck.

Thank again
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now