Saturday, March 20, 2010

Official Silverlight 4 Tools for VS 2010 RC is out

It was not long ago when VS2010 RC become available. One unfortunate thing with it, was that the SL 4 BETA tools were not supported on VS 2010 RC and there were tons of question when shall we expect version of SL 4 tools that will work with VS 2010 RC. Well, here they are:

http://msdn.microsoft.com/en-us/library/cc838244(VS.96).aspx

Silverlight 4 RC Developer Runtime + Silverlight 4 Tools for VS 2010 RC + WCF RIA Services RC.

I am not sure whether to be happy or sad for the last one. I was exploring the .NET RIA Services since their early CTP and I do have a project that uses Silverlight 3 RTM + WCF RIA Services Beta all developed on VS 2008. What was my surprise when I saw the installer splash screen of Silverlight 4 RC Tools. It was so kind to tell me that I have earlier version of WCF RIA Services, which will be uninstalled for the sake of new RC version. However, WCF RIA Services RC will only support Silverlight 4 and Visual Studio 2010 RC. So I decided to not make that big upgrade step of my project, because it is bit more complex than just a Silverlight application :). Anyway I know that sooner or later I will have to upgrade everything to 2010 versions because in either way WCF RIA Services will not support Silverlight 3.

The only solution to “touch” Silverlight 4 RC Tools without crashing all my previous work is to use a VM to play around. I just feel I have too many VMs :) I am saving one separate real HDD for all my VMs …

Monday, February 8, 2010

Visual Studio 2010 side-by-side with Visual Studio 2008

Well, BETA2 of Visual Studio 2010 was announced with GO LIVE license, upgrade capability to RTM and side-by-side working with existing VS2008 installations.

Well, maybe if you are using Visual Studio to compile and run your “Hello World” Console or Web Application you will have no issues running side-by-side.

However, if you really want to explore all the new technologies, while still keeping “old” projects running, you simply can’t use both Visual Studios side-by-side. And here is one particular case in which you simply have to choose whether to stay on VS2008 or go for VS2010 and migrate your projects to 2010, because they will not be supported on VS2008. The special case is called:

WCF RIA Services

RIA Services is designed to make our Silverlight life easier, but instead it brings only troubles (when using side-by-side). And why? Because WCF RIA Services works either with VS 2010 and SL4 OR VS2008 SP1 and SL3. There is no side-by-side! If you have existing project(s) on VS 2008 SP1 with WCF RIA Services, you simply can’t go and explore VS2010 SL4 and WCF RIA Services within VS 2010.

Although you might want to say it is limitation for WCF RIA – yes, it is. But I can use both VS2010 and VS2008SP1 for Windows Azure projects. And for me – side-by-side, means “side-by-side” without any “but”.

So for me so far – no side-by-side.

Sunday, February 7, 2010

MySQL hosted on Windows Azure

People are often asking whether MySQL is supported on Windows Azure. The simple answer is YES, you can run a MySQL on Windows Azure! Great!

But is it worth? I would say NO! And here are my thoughts on that.

First, take a sneak peak at the presentation of Mohit Srivastava and Tushar Shanbhag from PDC’09: Developing PHP and MySQL Applications with Windows Azure. Or download the slides and take a quick look of “OK, you can run MySQL on Windows Azure”. After one hour of amazing talk we will be almost convinced that we definitely can run MySQL on Windows Azure.

BUT…

I would question the value of bringing a MySQL to Azure!

What is Windows Azure? Here are just a couple of quotes from Introducing the Windows Azure platform and Introducing Windows Azure white papers:

Windows Azure is designed to support applications that scale out, running multiple copies of the same code across many commodity servers.

The intrinsic support for scale-out applications and scale-out data that Windows Azure provides can handle much larger loads than more conventional Web technologies.

The answer grows out of the primary Windows Azure goal of supporting massively scalable applications. Traditional relational databases can scale up, handling more and more users by running the DBMS on ever-larger machines. But to support truly large numbers of simultaneous users, storage needs to scale out, not up.

In resume – the goal of Windows Azure is to be highly scalable, highly reliable, highly available, elastic, etc. cloud system. And these white papers describe how is that scalability and reliability achieved.

Now, a quick sneak peak over the SLA (Service Level Agreement) that will assure our business for system up-time and availability. What we are most interested of using MySQL on Windows Azure is the Windows Azure Compute SLA. And the abstract of it sais:

For compute, we guarantee that when you deploy two or more role instances in different fault and upgrade domains your Internet facing roles will have external connectivity at least 99.95% of the time.

Additionally, we will monitor all of your individual role instances and guarantee that 99.9% of the time we will detect within two minutes when a role instance’s process is not running and initiate corrective action.

What does that mean to you, when are running MySQL? Rewind back to the Developing PHP and MySQL Applications with Windows Azure. What did they do? They have deployed a single instanced Worker Role that runs MySQL! Now I do have a couple of questions for you, if you are still going to host your MySQL in windows Azure:

  • 1. Will you have SLA for your MySQL deployment (which is the purpose of using Windows Azure)?
    • NO! And no, because your MySQL will be running on a single instanced role. You simply can’t run MySQL on multiple instances! Well you can, but you can’t really work with it.
  • 2. Will your MySQL be easily scalable (which is the purpose of using Windows Azure)?
    • NO! Because scaling out in Windows Azure is achieved by just increasing the number of instances that are running within your role. And if you want to “scale-out” a MySQL in Windows Azure, you will have to deploy entirely new worker role with single instance.

For me, there is just no worth of bothering with running MySQL on Windows Azure. You are going to loose all the strengths of Windows Azure and will utilize it just as virtual server hosting. Just give up on MySQL if you want to go with Windows Azure and refactor your PHP code to use SQL Azure!

And by the way … there will be almost the same issue with running PHP. However, this is easier to handle. Couple of important things you need to know in order to avoid hours of debugging a php code that is not debuggable – use a DataBase to store your sessions! If you want to scale out on Azure, do not ever use default sessions with PHP – move them to database. And let this database be SQL Azure. Well, moving sessions to database is the easier. You could also move the session to Windows Azure Tables.

If you want to write files on a “hard drive” – use Windows Azure Drive or go directly to Windows Azure Blob.

Monday, January 25, 2010

Jason Beres to speak in Sofia on Visual Studio 2010 and .NET 4

Next week we will be a host for an amazing session. It will be held on 2nd of February 2010 at Elieff Center for Education and Culture, 1 University Park str., Studentski grad 1700, Sofia.

“Building Better Experiences using Visual Studio 2010 and .NET 4”

As Visual Studio 2010 is right around the corner, and it's a completely new IDE based on WPF, chock full of exciting new features and productivity enhancers. So now is a great time to figure out the answers to these 2 key questions:
  • What's in Visual Studio 2010 and .NET 4 for me?
  • What is going to take to learn all of this?
In this talk, Jason will answer those questions. You'll get an understanding of the full run down of new features in Visual Studio 2010, including the new testing and debugging features, new data options, new deployment scenarios, new code editor features and many other new time savers and coding enhancers. You'll also get an understanding of new language features in Visual Basic and C#, as well as the new support for the F# language and the new project support for Silverlight 4, Windows Azure, SharePoint and Microsoft Office applications. At the conclusion of this talk, you'll know exactly why you need Visual Studio 2010 and .NET 4, and how they will improve your coding experience and capabilities to build even better software in 2010 and beyond!
Jason Beres is the VP of Product Management for Infragistics, the world leader in user interface development tools and experts in the User Experience (UX) market. Jason is a founder of Florida .NET User Groups, he is the founder of the Central New Jersey .NET User Group, he is a Microsoft MVP, and he is on the INETA Speakers Bureau. Jason is the author of several books on .NET development, including the recently published Silverlight 3 Programmers Reference from Wrox Press and the upcoming Silverlight 4 Professional from Wrox Press. Jason is a national and international conference speaker; he is a frequent columnist for several .NET publications, and keeps very active in the .NET community.
Expected duration of the lecture is about 1.5 hours and there will be catering party, excellent for networking after it.
See you there!

Sunday, December 13, 2009

Another common reason for Windows Azure role to stuck in Initializing/Busy/Stopping

There is another common reason that will cause your role to stuck into that loop when you deploy it on Windows Azure. And it is common for Web and Worker Roles.

You will most probably encounter this error if you are using latest Windows Azure Tools (as you should to) and you are creating a new project (rather than upgrading your existing one).

The new project template comes with enabled and started DiagnosticsMonitor. In order for this Monitor to work properly and collect and store data it needs a Windows Azure Storage account. The account configuration is saved as Role Configuration Entry in the .CSCFG file. The default “Connection string” is this one:

    1 <Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true" />

Note the “UseDevelopmentStorage=true” in the value for our DiagnosticsConnectionString. If you just make a “Hello World” Web Role and you upload it to Azure environment, that role will never start. It will go a Initializing/Busy/Stopping/Stopped loop. You need to either stop the DiagnosticsMonitor or change the connection string.

Lest first see how the connection string should look like:

    7       <Setting name="StorageClientAccount"

    8                value="DefaultEndpointsProtocol=[https|http];AccountName=[your_account_name];AccountKey=[your_account_key]" />

In this “Connection string” setting for Diagnostics monitor you need to provide:

  • DefaultEndpointsProtocol – http or https
  • AccountName – your storage account name (endpoints are automatically built up)
  • AccountKey – the authentication key that is generated at Storage management part of the portal.

Without specifying these settings your role will not run on Azure environment.

How about disabling DiagnosticsMonitor? Sure you can do so. If you have a WebRole there will be a single file defining a Class (usually called WebRole.cs) that derives from RoleEntryPoint. This class looks something like this:

   24 public class WebRole : RoleEntryPoint

   25 {

   26     public override bool OnStart()

   27     {

   28         DiagnosticMonitor.Start("DiagnosticsConnectionString");

   29 

   30         // For information on handling configuration changes

   31         // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

   32         RoleEnvironment.Changing += RoleEnvironmentChanging;

   33         ...

It is important to note line 28, on which there is a call: DiagnosticMonitor.Start("DiagnosticsConnectionString");

If want to remove the DiagnosticsMonitor just strip the entire OnStart() method. However I suggest not to do so, because you will loose all logging functionalities of Windows Azure.

I hope that this eliminates most common reasons for headaches of Windows Azure Role stuck in Initializing/Busy/Stopping/Stopped loops.