June 2009 - Posts
Last week at the SDN Event in Houten, I presented a session on Windows Azure and how you can develop applications on it. How it differs from developing for servers that run on premises. After the presentation, the question was asked if developing for Azure was a wise idea, as some stuff did not seem production ready.
After thinking a bit more about this, I believe the person based his question on the fact that I talked about two subjects
- Creating Azure Storage tables in the cloud and not being able to detect whether they’re there already.
Read this article from Steve Marx for more info, although since the article it changed a bit. Blog coming up on that. - Deleting all entries in a table (truncate table) isn’t (directly) possible via the API.
You’ll have to read every entry and delete each of them manually.
I’ve talked about this and perhaps because of this (or me) people got the impression Azure is not production ready. Maybe these issues will be solved, maybe not. These are all API related issues though and have nothing directly to due with Azure being production ready.
From what I’m observing, the Azure team is working really hard to get Azure working and perhaps spends less time on tooling and API. I’m very sure these will come in the near future, but we can already develop for Azure and it’s less important than getting a complex technology like Azure ready for release. And that’s what I am sure of, that the team is making sure Azure will work.
Is Windows Azure production ready?
The short and simple answer is probably no, because Windows Azure has not been officially released yet. But in my opinion it’s definitely worth checking out, because –as I said during the presentation- Microsoft is investing heavily on it. Invest in Azure now and reap the benefits of it sooner or later. It is expected that cloud computing will be as common in usage, as plugging in an electric device and instantly getting power is common right now.
Yesterday was a great day as the SDN Event took place in Houten. The location was really great and the food never has been better. The poll on the website shows others agree with me. Thanks to those who attended my sessions. Sorry to those who wanted to know more about SQL Data Services, but know that all I demoed yesterday in Silverlight 3 and .NET Ria Services should be (almost) immediately be transportable to Azure and SQL Data Services in the near future. I included scripts to generate the database for the Silverlight demo.
I have uploaded the slides and demos to the media section on BloggingAbout.NET.
- Windows Azure (slides and demo)
Met Windows Azure kunnen we applicaties hosten in de cloud. Maar wat betekent dat voor onze applicaties? En wat is het verschil tussen de web-role en worker-role? En hoe communiceren deze? Hoe slaan ze data op? Wat betekent dit voor development en deployment? Deze vragen zullen beantwoord worden in een sessie met weinig slides maar veel code om een WCF service te bouwen waarmee we informatie over mobiele flitsers beschikbaar maken. - SQL Data Services and Silverlight 3 (slides and demo)
Silverlight 3 heeft nieuwe mogelijkheden om eenvoudiger met een backend systeem te communiceren en gegevens uit een database te bewerken. Met SQL Data Services kun je een database 'in the cloud' plaatsen waarna je geen zorgen meer hebt over infrastructuur. Maar wat zijn de mogelijkheden en wat is er anders dan bij een lokale database? Nog interessanter wordt het als we deze twee technologieën gaan combineren. In deze sessie zal getoond worden hoe met Silverlight een LOB applicatie is te realiseren met het door Windows Azure gehoste SQL Data Services als storage model.
If you have questions about Azure, Azure Storage, .NET Services, Silverlight or anything else, don’t hesitate to contact me. And know that we give courses about all these subjects as well at Class-A! :-)
Now this got me puzzled today for some time. I started up Visual Studio 2008 and opened a solution I had been working on for some time. But when trying to debug the application, it threw an error on Unity and the SerivceLocator trying to get an instance of a class. Not an interface, a class. It had no constructor nor dependency properties or anything weird, but I used Unity because it was supposed to in the future.
Anyway, I got an error from Unity and some inner exception said
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Now that was super weird of course. Weirder even was that all tests, also using Unity, still all succeeded. So I replaced the line of code to instantiate the class by hand and it worked. A few lines further LINQ was used and the same error occurred. So I tried everything from running other applications and opening other VS2008 solutions, doing memory tests, etc, etc. Everything worked fine, but just this one project I was supposed to work on.
I Googled and even Blinged for some time, without finding anything relevant. Until I stumbled upon this thread in the Microsoft forums. There they did not find the error just weird, but wierd even.
Anyway, the solution was to enable JIT optimization. In other words, in Visual Studio 2008 choose “Tools” and then “Options”. Select “Debugging” and “General” and find the line that says “Suppress JIT optimization on module load”. This kind of makes sure that the debugger and the JIT compiled code aren’t running out of sync because the JIT compiler is such a super duper optimizer of your code. This did the trick.
Of course my code is so much optimized it never runs out of sync, but it still didn’t feel good. So I was trying to reproduce the error and turned “Supress JIT optimization” on again. To my even bigger surprise, the error did not return and my application is working just fine again. This even more ensured me turning it on or off on my own code, does not make a difference… ;-)
I just downloaded and installed Isolator 5.3.1 which has the ability to fake DateTime.Now, probably one of those functions in .NET you’ve always wanted to isolate correctly in tests. And now you can. For quick reference, check the Typemock Insider blog.
This can however be a breaking change in your unit tests. For example, we had the following test to verify of a DateTime was put into a property.
Isolate.Verify.WasCalledWithAnyArguments(() => someObject.ProcessDate = DateTime.Now);
With version 5.3.1 the test failed with the following error message.
TypeMock Verification: Method MyNameSpace.SomeClass.ProcessDate was called with mismatching arguments.
I fixed this by setting the following behavior on DateTime.Now.
// Arrange
var testDate = new DateTime(2000, 1, 1);
Isolate.WhenCalled(() => DateTime.Now).WillReturn(testDate);
// Act
// Some code here
// Assert
Isolate.Verify.WasCalledWithAnyArguments(() => someObject.ProcessDate = testDate);
As Dennis Doomen, I was quite happy with how the session went. Some stuff went by pretty fast, mainly because I did not want to present how the tools I used work, but did want to show the audience how I did it and what the tools are capable of.
Here’s the presentation if you’d like to review it and I’ve created a package with the demos as well. It contains…
- NerdDinner for Visual Studio 2008 in folder structure as specified in presentation
- FinalBuilder 6 script for building NerdDinner
- FinalBuilder 6 script for deploying a ClickOnce application as described in this article.