Skip to content

Project Cool - Harish Ranganathan
Syndicate content A web&ltdeveloper's&gtblog
experiments with ASP.NET, HTML5 & web development
Updated: 7 hours 53 min ago

Diving Deep: ASP.NET Membership and the new Universal Providers

Mon, 01/16/2012 - 11:53
</object> <script type="text/javascript"> document.write("<script type='text/javascript' src='" + (window.location.protocol) + "//c.microsoft.com/ms.js'" + "><\/script>");</script> </div></body>
Categories: Blogs

'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

Tue, 01/10/2012 - 18:21

Once you upgrade to the Windows Azure SDK 1.6 you also get the updated Microsoft Service Bus assemblies (version 1.6.0.0) that you can use for working with Windows Azure Service Bus (yeah, no longer AppFabric Service Bus)

One of the standard implementations of Service Bus is  to use the CredentialType, Credentials (the service bus namespace and the issuer key and issuer name) to create the service bus namespace URI.

Once you upgrade to Windows Azure Service Bus (Microsoft.ServiceBus) version 1.6.0.0, the following are the errors you might encounter.  These are rather warnings.

'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

'Microsoft.ServiceBus.TransportClientEndpointBehavior.CredentialType' is obsolete: '"This property is deprecated. Please use TransportClientEndpointBehavior.TokenProvider instead."'

'Microsoft.ServiceBus.TransportClientEndpointBehavior.Credentials' is obsolete: '"This property is deprecated. Please use TransportClientEndpointBehavior.TokenProvider instead."'

'Microsoft.ServiceBus.TransportClientEndpointBehavior.Credentials' is obsolete: '"This property is deprecated. Please use TransportClientEndpointBehavior.TokenProvider instead."'

While this is nicely documented in the release notes, the new equivalent for this is Token Provider.  So here below is a sample implementation code which uses Token Provider and TransportClientEndPointBehaviour namespaces.

Uri serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "SERVICE NAME”);

// create the credentials object for the endpoint

TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior();

TokenProvider tokenProvider = tokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerSecret);

sharedSecretServiceBusCredential.TokenProvider = tokenProvider;

// create the channel factory loading the configuration

ChannelFactory<IDirectoryService> channelFactory = new ChannelFactory<IDirectoryService>("DirectoryEndpoint", new EndpointAddress(serviceUri));

channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential);

Cheers!!!

Categories: Blogs

Windows Azure Service Bus November 2011 Release

Tue, 01/10/2012 - 16:34

I have been working on Windows Azure Service Bus for the recently concluded Azure Camps 

Yes, it is no longer referred as “Windows Azure AppFabric Service Bus”.  All the 3 components i.e. Service Bus, Access Control and Caching are hereinafter referred to as simply Windows Azure Service Bus, Caching & Access Control Service, to minimize the complexity in referring to them.

Also, Service Bus and the related releases usually come as an out of bound release and are usually behind in terms of the Windows Azure SDK releases.  The Windows Azure SDK latest release is the 1.6 version and along with, there is also a new version of the Service Bus.  Earlier, the Service Bus assemblies sit inside the C:\Program Files\Windows Azure AppFabric SDK folder.

With the 1.6 version of the release of SDK, the Service Bus assemblies also sit inside the regular Windows Azure SDK folder.  Therefore, you can find the latest version of Service Bus i.e. Microsoft.ServiceBus sits inside C:\Program Files\Windows Azure SDK\v1.6\ServiceBus\ref folder.

Similarly, the Caching assemblies sit inside C:\Program Files\Windows Azure SDK\v1.6\Cache\ref folder.

The latest version of ServiceBus is hence 1.6.0.0 and hence if you are installing, you need to make sure you update the assembly version in the config files. 

Otherwise, you would typically get the wrong assembly referenced error, as follow

Exception type:   System.Configuration.ConfigurationErrorsException
Message:          Configuration binding extension 'system.serviceModel/bindings/netTcpRelayBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.

Particularly, if you are using the http://www.microsoft.com/download/en/details.aspx?id=19925 Azure AppFabric samples, they reference the older version of the assembly.  And you need to update them. The release notes http://msdn.microsoft.com/en-us/library/windowsazure/hh667331.aspx covers pretty much line by line on the binding changes to be included in the config file. 

So, now, whether you develop for Windows Azure Hosted Services, Storage Services or Windows Azure Service Bus you need to install, just one SDK and all of them reside under the C:\Program Files\Windows Azure\SDK folder.

In my subsequent post, I want to cover a specific deprecated assembly, its implementation and the new equivalent.

Cheers !!!

Categories: Blogs

A day in the life of a Developer Evangelist!

Tue, 12/20/2011 - 20:43

The opinions mentioned herein are solely main and do not reflect those of my employer in any way...

Categories: Blogs

"Why WindowsPhone?" in conversation with Girish C Joshi

Mon, 12/19/2011 - 17:42
</object> <script type="text/javascript"> document.write("<script type='text/javascript' src='" + (window.location.protocol) + "//c.microsoft.com/ms.js'" + "><\/script>");</script> </div></body></html>
Categories: Blogs

"What is WebMatrix?" in conversation with Sarvashrestha Paliwal on Web Technologies

Mon, 12/19/2011 - 17:33
</object><script type="text/javascript"> document.write("<script type='text/javascript' src='" + (window.location.protocol) + "//c.microsoft.com/ms.js'" + "><\/script>");</script></div></body>
Categories: Blogs

EFProviders require MultipleActiveResultSets=True for System.Data.SqlClient connection strings

Tue, 12/13/2011 - 10:55

I was playing with the new Membership API (System.Web.Providers) for the upcoming Virtual TechDays  

While I was trying out a lot of options for using as DB store, one of the obvious choices was SQL Azure.  With SQL Azure, I could offload the Database hosting capabilities to Azure and just focus on my application code.  Of course, it comes at a cost and SQL Azure is a subscription based database available in different sizes and rates there of.

One of the challenges I faced was, working with the Membership API’s connectionstring called as “DefaultConnection”.  The Default Connection is something you would use simply for all connection strings once you upgrade the application to use the New Membership API.  While configuring the connection string, I copied an existing connection string of SQL Azure and changed just the database name.

The new Membership API is supposed to create the database if it doesn’t exist and then use it for creating tables for storing users, roles, etc.,  It failed!!

The error precisely I got was the title i.e. “EFProviders require MultipleActiveResultSets=True for System.Data.SqlClient connection strings.”

I was doubly sure that the attribute existed in connection string and moved it around, as much closer to the other attributes i.e. User Id, Database name etc.,  Still no luck.

This connection string had earlier worked with SQL Azure in another application earlier and I was also damn sure about it.  The only difference was that application wasn’t using the new Membership API.

Then, I changed the case of the attribute (lowercase) to camel case to make it “MultipleActiveResultSets” and voila, it worked!!

I couldn’t believe that this was the problem but eventually figured that, indeed it was Smile

So, if you hit the above error and are sure that the attribute exists, make sure, it is of pascal case.  The Membership API doesn’t like it in other formats Smile

Cheers!!!

Categories: Blogs