The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








I heart FeedBurner

Latest Diggs - Programming

Computers Blogs - Blog Top Sites

Site Hits

Total: 4,904,749
since: 19 Jan 2005

Getting the ASP.NET Providers working on the Azure Nov 2009 CTP

posted Sun 15 Nov 09

If you've been trying to get the ASP.NET providers working on the November 2009 CTP of Windows Azure then you may have run into a snag, or a couple snags if you're using Visual Studio 2010.

First of all, if you're using Visual Studio 2010 Beta 2, then you're going to need to either up-convert the AspProviders project. For this, you want to go and grab the AspProviders (VS2008) sample from the Azure Code Samples home page. Once you've got it, you can either compile it in Visual Studio 2008 or, if you're coding in VS2010 Beta 2, you can either reference the compiled binary directly or just up-convert the project to VS2010 Beta 2.

The new AspProviders sample uses the new Microsoft.WindowsAzure.StorageClient library that now comes with the new version of the SDK. This version of the storage client is more robust, better supported, and more efficient than the sample storage client from previous versions of the SDK.

First, you're going to want to rig up your Web.config to use the new provider with elements like this:

<membership defaultProvider="TableStorageMembershipProvider" 
userIsOnlineTimeWindow = "20">
      <providers>
        <clear/>
        <add name="TableStorageMembershipProvider"
             type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageMembershipProvider"
             description="Membership provider using table storage"
             applicationName="AspProvidersDemo"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             minRequiredPasswordLength="1"
             minRequiredNonalphanumericCharacters="0"
             requiresUniqueEmail="true"
             passwordFormat="Hashed"
                />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="TableStorageRoleProvider" 
cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="30"
                 cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration = "true"
                 cookieProtection="All" >
      <providers>
        <clear/>
        <add name="TableStorageRoleProvider"
             type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageRoleProvider"
             description="Role provider using table storage"
             applicationName="AspProvidersDemo"
                />
      </providers>
    </roleManager>
    <!--<profile enabled="true" defaultProvider="TableStorageProfileProvider"
inherits="UserProfile">
      <providers>
        <clear/>
        <add name="TableStorageProfileProvider"
             type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageProfileProvider"
             description="Profile provider using structured storage"
             applicationName="AspProvidersDemo"
                />
      </providers>
      --><!--  
            <properties>
                <add name="Country" type="string"/>
                <add name="Gender" type="string"/>
                <add name="Age" type="Int32"/>
            </properties>
            --><!--
    </profile>-->
    <sessionState mode="Custom" customProvider="TableStorageSessionStateProvider">
      <providers>
        <clear />
        <add name="TableStorageSessionStateProvider"
             type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider"
             applicationName="AspProvidersDemo"
             />
      </providers>
    </sessionState>

You might have noticed that I've commented out the profile provider. This is because if you use the profile provider, you might run into a problem where an exception is thrown at runtime (during app startup) that complains about you attempting to access an unloaded AppDomain. Microsoft is aware of this and I'm expecting to shortly see a workaround, fix, or an update to the SDK. In the meantime, just comment out the profile provider and you'll be able to use the provider samples as-is.

Keep checking back here for more blog posts on using the new Nov 09 CTP of Windows Azure and any potential updates/fixes to this particular issue with the profile provider.

tags:        

links: digg this    del.icio.us    technorati    reddit

AddThis Social Bookmark Button




1. be789 left...
Sun 15 Nov 09 10:54 pm

You also need to add the AccountName, AccountSharedKey, and endpoints in <appSettings>, right?


2. Kevin Hoffman left...
Mon 16 Nov 09 9:20 am

Yes, those are required for the AspProviders sample, regardless of how you're using it or what development environment (VS08 or VS10) you're using.


3. be789 left...
Wed 18 Nov 09 2:29 am

AspProviders from earlier Azure builds didn't require the credentials to be in <appSettings \>. I wonder how to get around that. Also, I wonder how to have AspProviders simply read the new DataConnectionString in ServiceConfiguration.cscfg.


4. Kevin Hoffman left...
Wed 18 Nov 09 8:09 am

All versions of the AspProviders sample read the credentials from config - using an elaborate and (IMHO) incorrect method to scan both your web.config and your service configuration file. This applies to old as well as new.


5. be789 left...
Wed 18 Nov 09 8:36 pm

I should have been more clear. Previous versions of AspProviders could read from ServiceConfiguration.cscfg, but the November version appears to only read from web.config.


6. Kevin Hoffman left...
Wed 18 Nov 09 8:42 pm

The AspProviders thing is purely a sample and Microsoft is continually working on it. I also noticed that it doesn't seem to read the information out of the service configuration file. Here's my thought: I'm OK using AspProviders in test..but when i put an application to production, you can bet I won't be using the Microsoft _sample_ code when I put it there.


Tag Related Posts

Html.JqGrid - Cleaning up your jqGrid Code

Tue 22 Dec 09 8:46 P GMT-05
tags:              

How to Build your First Azure-Powered MVC App

Tue 29 Sep 09 2:16 P GMT-05
tags:        

Configuration Settings in Azure Applications

Mon 28 Sep 09 2:59 P GMT-05
tags:        

ViewState is the Froo-It of the Dev-Il

Wed 23 Sep 09 3:09 P GMT-05
tags:      

Fix for Minor Bug in ASP.NET MVC New Project Template

Mon 04 May 09 2:48 A GMT-05
tags:      

Velocity CTP3 coming up next week

Thu 12 Mar 09 4:44 P GMT-05
tags:            

SSDS loses an "S" and gains some awesome

Wed 11 Mar 09 11:42 A GMT-05
tags:              

Live Mesh Tutorial 1 - Hello Live Mesh

Thu 06 Nov 08 2:33 P GMT-05

Microsoft Windows Azure Distilled

Tue 28 Oct 08 1:42 P GMT-05

NYC SharePoint Developer Needed

Mon 12 May 08 12:09 P GMT-05

Scott Guthrie Updates the ASP.NET MVC Roadmap

Wed 13 Feb 08 3:49 P GMT-05
tags:    

Volta is to Ajax what Tums is to my Stomach

Wed 30 Jan 08 4:11 P GMT-05

ASP.NET 3.5 Extensions Preview Released

Mon 10 Dec 07 2:10 P GMT-05

Microsoft unveils an MVC framework for ASP.NET

Mon 08 Oct 07 12:58 P GMT-05
tags:      

Acropolis or Acrapolis?

Thu 05 Jul 07 12:34 P GMT-05
tags:      

Visual Studio "Orcas" - March CTP is Available

Wed 28 Feb 07 12:28 P GMT-05
tags:            

ASP.NET Ajax v1.0 Beta

Fri 27 Oct 06 6:17 P GMT-05
tags:      

ASP.NET vs Ruby on Rails : Round 2 (Agility)

Thu 05 Oct 06 11:02 A GMT-05
tags:                      

ASP.NET vs Ruby on Rails : Round 1

Wed 04 Oct 06 1:37 P GMT-05
tags:                

July CTP is out... yay.

Tue 18 Jul 06 6:34 P GMT-05
tags: