Welcome!

Microsoft Cloud Authors: Andreas Grabner, Nick Basinger, Kevin Benedict, Pat Romanski, Liz McMillan

Blog Feed Post

ASP.NET – Membership Hides Its Privileges

One of the problems I have had thus far with my foray into ASP.NET has been a simple concept.  How do you deal with users logging in.  Not so much the actual mechanics of it, but where is the data, and how can I get to it?  By default, when you are using forms based authentication, that data is stored in tables that you cannot easily get to, and certainly not in the Solutions Explorer.  Essentially, nothing is showing up in your “App_Data” node, and there is no .MDF file to add from your project directory.

What then are you to do when you want to have direct access to your membership tables from within Visual Studio?  Well, let me walk you through the steps, as I did them, to achieve this.  I won’t say that this is the official way, but it’s what worked for me.  I hope to save you some of the pain and suffering associated with my searching on the web to find these answers.

Create your new project

This is self-explanatory.

Turn on forms based authentication

This is accomplished by editing your web.config file.  Look for the following:

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login" />
</authentication>
Run the ASP.NET Configuration

It’s important that you don’t look for this option (under the “Project” menu) when you have the web.config file as your open window.  It won’t be there.

Add A User

Click on the security tab, and from there you can manage your users.  Add one.  One time when I did this, I saw the following error:

The following message may help in diagnosing the problem: Could not find stored procedure ‘dbo.aspnet_CheckSchemaVersion’.

The annoying bit was that when I tested the connection, through the tool, it was able to successfully establish a connection.  Wonderful.  I am not sure how I fixed this the one time I hit it, but I wanted to throw it out there as a potential issue.

The Unfun Complicated Bit

So, this is where having a friend on the dev team is important.  I had read one of the tutorials over at asp.net which had content on this topic. They tell you to run “aspnet_regsql” from a Visual Studio command prompt.  If you do nothing else, know this: if you are using SQL Express, your server that you want to connect to is in the form of <machine name>\sqlexpress.  If you get that wrong, this tool will fail.  Always.  That’s roughly two hours I just saved you.

I am not sure what this tool did that this command line bit didn’t do for me (courtesy developer friend).

NAVIGATE TO:

C:\Windows\Microsoft.NET\Framework\v2.0.50727>

RUN:

aspnet_regsql.exe -d "<path to project dir>\<projectname>\App_Data\ASPNETDB.MDF"

With the following options:

-A all -C "Data Source=.\SQLEXPRESS;Integrated Security=True;User Instance=True"

If everything goes according to plan, you will see:

Start adding the following features:
Membership
Profile
RoleManager
Personalization
SqlWebEventProvider
…..
Finished.

If not, you will see many errors. This broke for me when the ASPNETDB.MBF file was not already there.  It showed up for me only after I had successfully built and run the project and added a user.  The asp.net mvc default app has a new user wizard, which I could also use (which I did when I hit that stored proc error above in “Add a User.”  Of course it worked, and I don’t know why.

Add the Database File

In the Solutions Explorer Window, right mouse click, and select “Add/Existing Item.”  Select ASPNETDB.MDF.  Careful that you don’t select the _log file.  I did that.  Don’t do what I did.  Fail.

There you go.  A step by step, “how the hell do I get my user tables into my project so that I can edit them” tutorial.  Hopefully this saves some poor unsuspecting n00b some time.

Read the original blog entry...

More Stories By Brandon Watson

Brandon Watson is Director for Windows Phone 7. He specifically focuses on developers and the developer platform. He rejoined Microsoft in 2008 after nearly a decade on Wall Street and running successful start-ups. He has both an engineering degree and an economics degree from the University of Pennsylvania, as well as an MBA from The Wharton School of Business, and blogs at www.manyniches.com.

IoT & Smart Cities Stories
When Enterprises started adopting Hadoop-based Big Data environments over the last ten years, they were mainly on-premise deployments. Organizations would spin up and manage large Hadoop clusters, where they would funnel exabytes or petabytes of unstructured data.However, over the last few years the economics of maintaining this enormous infrastructure compared with the elastic scalability of viable cloud options has changed this equation. The growth of cloud storage, cloud-managed big data e...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
After years of investments and acquisitions, CloudBlue was created with the goal of building the world's only hyperscale digital platform with an increasingly infinite ecosystem and proven go-to-market services. The result? An unmatched platform that helps customers streamline cloud operations, save time and money, and revolutionize their businesses overnight. Today, the platform operates in more than 45 countries and powers more than 200 of the world's largest cloud marketplaces, managing mo...
Your applications have evolved, your computing needs are changing, and your servers have become more and more dense. But your data center hasn't changed so you can't get the benefits of cheaper, better, smaller, faster... until now. Colovore is Silicon Valley's premier provider of high-density colocation solutions that are a perfect fit for companies operating modern, high-performance hardware. No other Bay Area colo provider can match our density, operating efficiency, and ease of scalability.
CloudEXPO has been the M&A capital for Cloud companies for more than a decade with memorable acquisition news stories which came out of CloudEXPO expo floor. DevOpsSUMMIT New York faculty member Greg Bledsoe shared his views on IBM's Red Hat acquisition live from NASDAQ floor. Acquisition news was announced during CloudEXPO New York which took place November 12-13, 2019 in New York City.
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Atmosera delivers modern cloud services that maximize the advantages of cloud-based infrastructures. Offering private, hybrid, and public cloud solutions, Atmosera works closely with customers to engineer, deploy, and operate cloud architectures with advanced services that deliver strategic business outcomes. Atmosera's expertise simplifies the process of cloud transformation and our 20+ years of experience managing complex IT environments provides our customers with the confidence and trust tha...
The graph represents a network of 1,329 Twitter users whose recent tweets contained "#DevOps", or who were replied to or mentioned in those tweets, taken from a data set limited to a maximum of 18,000 tweets. The network was obtained from Twitter on Thursday, 10 January 2019 at 23:50 UTC. The tweets in the network were tweeted over the 7-hour, 6-minute period from Thursday, 10 January 2019 at 16:29 UTC to Thursday, 10 January 2019 at 23:36 UTC. Additional tweets that were mentioned in this...
Today's workforce is trading their cubicles and corporate desktops in favor of an any-location, any-device work style. And as digital natives make up more and more of the modern workforce, the appetite for user-friendly, cloud-based services grows. The center of work is shifting to the user and to the cloud. But managing a proliferation of SaaS, web, and mobile apps running on any number of clouds and devices is unwieldy and increases security risks. Steve Wilson, Citrix Vice President of Cloud,...
Artificial intelligence, machine learning, neural networks. We're in the midst of a wave of excitement around AI such as hasn't been seen for a few decades. But those previous periods of inflated expectations led to troughs of disappointment. This time is (mostly) different. Applications of AI such as predictive analytics are already decreasing costs and improving reliability of industrial machinery. Pattern recognition can equal or exceed the ability of human experts in some domains. It's devel...