Archives
All the articles I've archived.
-
Referencing a Specific Assembly from a NuGet Package
-
Building an ASP.NET Core Tag Helper to Show/Hide UI Elements based on Authorization
-
Streaming a Community Event on YouTube Using StreamYard
-
Streaming a Community Event on YouTube - Sharing the Technologies and Learnings from Virtual Azure Community Day
-
Can .NET Core Framework Assemblies be Mapped back to Individual NuGet Packages? A Detective Story
-
Unit testing for ValidateAntiForgeryToken and clever navigation in the ReSharper/Rider test runner
-
Tracking down action methods that need ValidateAntiForgeryToken using Structural Search and Replace
-
Help, I've inherited an ASP.NET MVC Core code base with no Cross-Site Request Forgery (CSRF) measures!
-
Using operator overloads for concatenating file system paths in CSharp
The past few days, I’ve been working on some cross-platform C# code. In this code, I needed to build a path to a file, by concatenating folder names. As you may know the path separator on Windows and Linux operating systems are different: one has a backward slash (\), the other has a forward slash (/). Luckily for me, the .NET framework(s) contain a utility function for this: Path.Combine handles this for me! Here’s an example: This will generate a platform-specific path: Great! However, I found something else in the codebase I was working on (ReSharper): Whoa! This almost looks like path separators! And the great thing is that this also returns a platform-specific path.
-
On speaker life...
Last week, I did a tweet while at the Paris Charles de Gaulle airport, working on blog posts (part of my job) and drinking bad coffee. The backstory is I just finished a week of conference and speaking (Microsoft Experiences Paris, JetBrains Night Paris) and there is of course some real work to be done in between all the “glamour” of public speaking. Many people I talk with at user groups or conferences sometimes feel speakers at conferences are special and rockstars and have glamourous lifes. In this post I want to touch on that, and also on a reply I got to my tweet: Before going into those, let’s first look at how I started speaking at user groups and conferences, and go from there.
-
Building a scheduled task in ASP.NET Core/Standard 2.0
In this post, we’ll look at writing a simple system for scheduling tasks in ASP.NET Core 2.0. That’s quite a big claim, so I want to add a disclaimer: this system is mainly meant to populate data in our application’s cache in the background, although it can probably be used for other things as well. It builds on the ASP.NET Core 2.0 IHostedService interface. Before we dive in, I want to give some of the background about why I thought of writing this. At JetBrains, various teams make use of a Slack bot, which we write in Kotlin. This bot performs various tasks, ranging from saying “Hi!” to managing our stand-ups to keeping track of which developer manages which part of our IDE’s. While working on the bot code, I found this little piece of code:
-
Making string validation faster by not using a regular expression. A story.
-
Extending .NET CLI with custom tools - dotnet init initializes your NuGet package
A few weeks back, .NET Core 1.1 was released (and a boatload of related tools such as Visual Studio 2017. For .NET Core projects, a big breaking change was introduced: the project format is no longer project.json but good old .csproj. That’s a little bit of a lie: the .csproj is actually an entirely new, simplified format that combines the best of the old .csproj and project.json and works with .NET Standard and .NET Core. What I personally like about the new .csproj format, is how easy it is to create NuGet packages with it. Just add a few MSBuild properties, run msbuild pack or dotnet build and be done with it. But which properties are available? A whole list, it seems. Let me introduce you to a tool to make this easier, and how it was built.
-
Using dotPeek to figure out why IIS crashed
Here’s a story on how I once used dotPeek to provide debugger symbols and (decompiled) source code for a crashed application for which we had nothing but the application assemblies available. Namespaces have been altered to protect the innocent. Nothing better than a good cup of coffee in the morning! Opening up the issue tracker, “the folks from IT” logged an issue about an application server crashing over night. They automatically captured a crash dump of the IIS worker process and attached it to the issue - this should help in diagnosing the root cause of that crash. One more coffee refill, and then let’s dive in!
-
Application Insights telemetry processors
-
Exploring .NET managed heap with ClrMD
Since my posts on making code allocate less memory and memory allocation for strings were quite well received, I decided to add another post to the series: Exploring .NET managed heap with ClrMD. In this post, we’ll explore what is inside .NET’s managed heap (you know, the thing where we alocate our objects), how it’s structured and how we can do some cool tricks with it. We’ll even replicate dotMemory’s dominators/path to root feature. So what is ClrMD? ClrMD is the short name for the Microsoft.Diagnostics.Runtime package which lets us inspect a crash dump or attach to a live process and perform all sorts of queries against the runtime. For example walking the heap (which we’ll do later), inspecting the finalizer queue, and more. In this series:
-
Exploring memory allocation and strings
A while back, I wrote about making code allocate less memory (go read it now if you haven’t). In that post, we saw how the Garbage Collector works and how it decides to keep objects around in memory or reclaim them. There’s one specific type we never touched on in that post: strings. Why would we? They look like value types, so they aren’t subject to Garbage Collection, right? Well… Wrong. Strings are objects like any other object and follow the same rules. In this post, we will look at how they behave in terms of memory allocation. Let’s see what that means. In this series:
-
Making .NET code less allocatey - Allocations and the Garbage Collector
-
Hotel California
At the start of 2015, I checked out from JetBrains to join Microsoft. Today, after almost two years in the NuGet team, it’s time for change. Microsoft and NuGet have been a fun ride, and I got to complete my personal mission… I remember Paul Stack trolling me (“Hey Maarten, is NuGet down?”) on more than one occasion, and am really happy that I got the freedom and support for changing that. The quest towards server stability even got me a well-received conference talk, “Sherlock Homepage”. Thanks Jeff (x2), Yishai, Hari, Jun and team! Mission accomplished! And thanks for the great walks in wonderful Washington state when I was over there, I’ll sure miss stopping by that region every once in a while.
-
NuGet and NPM news from the community
You may know (or not, shame on you!) Xavier Decoster and myself are operating MyGet, a hosted service providing teams with hosting and management of NuGet, npm, Bower, VSIX and debugger symbols. Recently, we started looking into how we could do better on the content marketing front, an important piece of getting people to visit and hopefully sign up to our service. We decided on starting a series on the MyGet blog, named “NuGet and NPM news from the community”.
-
Building NuGet (.NET Core) using Atlassian Bitbucket Pipelines
A while back, I signed up for the beta of Bitbucket Pipelines, a new continuous integration service from Atlassian, built into Bitbucket. The build system promises easy configuration using YAML files to describe the build steps. It runs builds in a Docker image, so that means we can also use it for building and packaging .NET Core libraries. Let’s see how. I created a simple .NET Core library which contains a useless Hello.cs class, and a project.json that holds project metadata. The class itself is not very interesting, the project.json file is:
-
Someone broke the Internet! Or why you may want to mirror your dependencies…
Twitter celebrated its 10th birthday this week, and those who have been on that social network long enough know that at least once a week there’s a massive outrage about something that, in the end, usually does not seem so bad. This week’s topic: someone broke the Internet!
-
Disabling session affinity in Azure App Service Web Apps (Websites)
In one of our production systems, we’re using Azure Websites to host a back-end web API. It runs on several machines and benefits from the automatic load balancing we get on Azure Websites. When going through request logs, however, we discovered that of these several machines a few were getting a lot of traffic, some got less and one even only got hit by our monitoring system and no other traffic. That sucks! In our back-end web API we’re not using any session state or other techniques where we’d expect the same client to always end up on the same server. Ideally, we want round-robin load balancing, distributing traffic across machines as much as possible. How to do this with Azure Websites?
-
Working with a private npm registry in Azure Web Apps
Using Azure Web Apps, we can deploy and host Node applications quite easily. But what to do with packages the site depends on? Do we have to upload them manually to Azure Web Apps? Include them in our Git repository? None of that: we just have to make sure our app’s package,json is checked in so that Azure Web Apps can install them during deployment. Let’s see how.
-
Not enough space on the disk - Azure Cloud Services
I have been using Microsoft Azure Cloud Services since PDC 2008 when it was first announced. Ever since, I’ve been a huge fan of “cloud services”, the cattle VMs in the cloud that are stateless. In all those years, I have never seen this error, until yesterday: There is not enough space on the disk.at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)at System.IO.BinaryWriter.Write(Byte[] buffer, Int32 index, Int32 count) Help! Where did that come from! I decided to set up a remote desktop connection to one of my VMs and see if any of the disks were full or near being full. Nope!
-
Replaying IIS request logs using Apache JMeter
How would you validate a new API is compatible with an old API? While upgrading frameworks in a web application we’re building, that was exactly the question we were asking ourselves. Sure, we could write synthetic tests on each endpoint, but is that representative? Users typically find insane better ways to test an API, so why not replay actual requests against the new API? In this post, we’ll see how we can do exactly this using IIS and Apache JMeter. I’ve been using JMeter quite often in the past years doing web development, as it’s one of the most customizable load test and functional test tools for web applications. The interface is quite spartan, but don’t let that discourage you from using JMeter. After all, this is Sparta!
-
Writing and distributing Roslyn analyzers with MyGet
Pretty sweet: MyGet just announced Vsix support has been enabled for all MyGet customers! I wanted to work on a fun example for this new feature and came up with this: how can we use MyGet to build and distribute a Roslyn analyzer and code fix? Let’s see. Roslyn analyzers and code fixes allow development teams and individuals to enforce certain rules within a code base. Using code fixes, it’s also possible to provide automated “fixes” for issues found in code. When writing code that utilizes DateTime, it’s often best to use DateTime.UtcNow instead of DateTime.Now. The first uses UTC timezone, while the latter uses the local time zone of the computer the code runs on, often introducing nasty time-related bugs. Let’s write an analyzer that detects usage of DateTime.Now!
-
Domain Routing and resolving current tenant with ASP.NET MVC 6 / ASP.NET 5
So you’re building a multi-tenant application. And just like many multi-tenant applications out there, the application will use a single (sub)domain per tenant and the application will use that to select the correct database connection, render the correct stylesheet and so on. Great! But how to do this with ASP.NET MVC 6? A few years back, I wrote about ASP.NET MVC Domain Routing. It seems that post was more popular than I thought, as people have been asking me how to do this with the new ASP.NET MVC 6. In this blog post, I’ll do exactly that, as well as provide an alternative way of resolving the current tenant based on the current request URL.
-
s/JetBrains/Microsoft
December 9th, 2012., was my first day at JetBrains, after being in consultancy for a good 7 years. Hadi Hariri, my new boss, showed the world how new employees are treated. If you know Hadi, that was obviously just for laughs. Not one day have I considered him as a boss, yet as a friend who worked with me on great things. I had a great time in the past two years working with him and the many awesome people at JetBrains. I have traveled a lot, written many blog posts and tutorials (less on my own blog, I admit) and much, much more. Thanks, JetBrains, thanks, community I have worked with, and thanks, Hadi, for making this an awesome time! It’s been a great opportunity and a great adventure.
-
Building future .NET projects is quite pleasant
You may remember my ranty post from a couple of months back. If not, read about how building .NET projects is a world of pain and here’s how we should solve it. With Project K ASP.NET vNext ASP.NET 5 around the corner, I thought I had to look into it again and see if things will actually get better… So here goes!
-
There is no good mobile operating system
I’m back on Windows Phone. If you follow me on Twitter, you may have read in the past weeks that I switched from being a Windows Phone user to being an Android user. Having been on the platform since before Windows Phone 7 was RTM, I found the operating system was getting slower and slower and less stable on my Nokia Lumia 620. So when I saw a shiny Android being fast, stable and having all the apps I needed, I was sold. Until today, when I switched back to a Windows Phone device. And maybe I’ll switch back again.
-
Could not load file or assembly… NuGet Assembly Redirects
When working in larger projects, you will sometimes encounter errors similar to this one: “Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.” Or how about this one? “System.IO.FileLoadException : Could not load file or assembly 'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)”
-
Automatically strong name signing NuGet packages
Some developers prefer to strong name sign their assemblies. Signing them also means that the dependencies that are consumed must be signed. Not all third-party dependencies are signed, though, for example when consuming packages from NuGet. Some are signed, some are unsigned, and the only way to know is when at compile time when we see this: That’s right: a signed assembly cannot consume an unsigned one. Now what if we really need that dependency but don’t want to lose the fact that we can easily update it using NuGet… Turns out there is a NuGet package for that!
-
Developing for the Tessel with WebStorm
In a previous post, I mentioned that (finally) my Tessel arrived, “an internet-connected microcontroller programmable in JavaScript”. I like WebStorm a lot as an IDE, and since the Tessel runs on JavaScript code (via node), why not see if WebStorm can be more than just an editor for Tessel development… The Tessel runs JavaScript, so naturally a JavaScript IDE like WebStorm will be splendid at that part. It provides a project system, code completion, navigation, inspections to check whether my code is as it should be (which from the screenshot below, it is not, yet ;-)) and so on.
-
Getting Started with the Tessel
Somewhere last year (I honestly no longer remember when), I saw a few tweets that piqued my interest: a crowdfunding project for the Tessel, “an internet-connected microcontroller programmable in JavaScript”. Since everyone was doing Arduino and Netduino and JavaScript is not the worst language ever, I thought: let’s give these guys a bit of money! A few months later, they reached their goal and it seemed Tessel was going to production. Technical Machine, the company behind the device, sent status e-mails on their production process every couple of weeks and eventually after some delays, there it was!
-
What happened to Code Spaces could happen to you. On Amazon, Azure and any host out there.
Earlier this week, a sad thing happened to the version control hosting service Code Spaces. A malicious person gained access to their Amazon control panel and after demanding a ransom to the owners of Code Spaces, that malicious person started deleting data and EC2 instances. After a couple of failed attempts from Code Spaces to stop this from happening, the impossible happened: the hacker rendered Code Spaces dead. Everything that was their business is gone. As they state themselves: Code Spaces will not be able to operate beyond this point, the cost of resolving this issue to date and the expected cost of refunding customers who have been left without the service they paid for will put Code Spaces in a irreversible position both financially and in terms of on going credibility.
-
Microsoft Azure cloud plugin for TeamCity (dabbling in Java code)
If you follow me on Twitter, you may have seen me in several stages of anger at Java. After two weeks of learning, experimenting, coding and even getting it all to compile, I’m proud to announce an inital very early preview of my Microsoft Azure cloud plugin for TeamCity. This plugin provides Microsoft Azure cloud support for TeamCity. By configuring a Microsoft Azure cloud in TeamCity, a set of known virtual build agents can be started and stopped on demand by the TeamCity server so we can benefit from Microsoft Azure’s cost model (a stopped VM is almost free) and scaling model (only start new instances when we need them).
-
Optimizing calls to Azure storage using Fiddler
Last week, Xavier and I were really happy for achieving a milestone. After having spent quite some evenings on bringing Visual Studio Online integration to MyGet, we were happy to be mentioned in the TechEd keynote and even pop up in quite some sessions. We also learned ASP.NET vNext was coming and it would leverage NuGet as an important part of it. What we did not know, however, is that the ASP.NET team would host all vNext preview packages from MyGet. But we soon noticed and found our evening hours were going to be very focused for another few days… On May 12th, we all of a sudden saw usage of our service double in an instant. Ouch! Here’s what Google Analytics told us:
-
Speeding up ASP.NET vNext package restore
TL;DR: If you have multiple NuGet feeds configured on your machine, it may be worth to do some tweaking in the NuGet.config file shipping with your project. Last week, the ASP.NET team released a preview of “ASP.NET vNext”, a first step in the good direction for solving the pain building .NET projects is, but more than that a great step towards having an open and cross-platform ASP.NET that is super developer friendly. If you haven’t checked it out yet, do so now.
-
Building .NET projects is a world of pain and here’s how we should solve it
During the past few weeks, I’ve been working on and off on setting up a build agent that can build as many open-source .NET projects as possible in an effort to learn how hard it is to do. Allow me to open this blog post with a rant… One which will feel very familiar if you’ve recently installed a build agent yourself.
-
NuGet Configuration File inheritance is awesome
One way to remove friction from using NuGet in multiple projects is by making use of NuGet Configuration File inheritance, probably the awesomest unknown feature in there. By default, all NuGet clients (the command-line tool, the Visual Studio extension and the Package Manager Console) all make use of the default NuGet configuration file which lives under %AppData%\NuGet\NuGet.config. NuGet can make use of other configuration files as well! In fact, NuGet can walk an entire tree of configuration files and fetch settings from those.
-
Windows Azure Storage magic with Shared Access Signatures
When building cloud applications on Windows Azure, it’s always a good thing to delegate as much work to specialized services as possible. File downloads would be one good example: these can be streamed directly from Windows Azure blob storage to your client, without having to pass a web application hosted on Windows Azure Cloud Services or Web Sites. Why occupy the web server with copying data from a request stream to a response stream? Let blob storage handle it! When thinking this through there may be some issues you may think of. Here are a few: Let’s answer these! Keeping blobs secure is pretty easy on Windows Azure Blob Storage, but it’s also sort of an all-or-nothing story… Either you make all blobs in a container private, or you make them public.
-
Source Control considered harmful
TL;DR: Using source control is a really bad idea. Or is it? Skip to Conclusion for the meat of this post. One of the first things I do with a new project in Visual Studio is not add it to source control. There are many reasons, but it all boils down to this: Source Control introduces more problems than it solves. Before I dive into this, I'll share the solution with you. Put your sources on a USB drive. Yes, it's that simple. If you're like most other people, you don't like that solution, because it feels inefficient: All of that is true, but then again... Still, many people go for source control: Source Control and a central repository solve all implications of using a USB drive, so why not use source control?
-
Pro NuGet second edition is out
Pfew! Around February 2013, Xavier and I started planning work on an update of our book. Eight months later, we’re proud to present you with Pro NuGet (second edition). It’s been a tough couple of months writing this: Xavier has become a father for the second time (congratulations!), we’ve had two massive updates to NuGet we had to work in our book, … But here it is! What’s new? Next to that there is a lot more meat in there! We would love to get your feedback! E-mail us or write a review on your blog or Amazon. Enjoy the read! PS: Thanks to our excellent reviewers (the NuGet team) and everyone at Apress! There is a lot of people involved in getting a quality book out there. Thanks!
-
A new year's present: introducing Glimpse plugins for Windows Azure
Have you tried Glimpse before? It shows you server-side information like execution times, server configuration, request data and such in your browser. At the February MVP Summit this year, Anthony, Nik and I had a chat about what would be useful information to be displayed in Glimpse when working on Windows Azure. Some beers and a bit of coding later, we had a proof-of-concept showing Windows Azure runtime configuration data in a Glimpse tab. Today, we are happy to announce a first public preview of two Windows Azure tabs in Glimpse: the Glimpse.WindowsAzure package displaying runtime information, and Glimpse.WindowsAzure.Storage collecting information about traffic from and to storage.
-
Visual Studio Online for Windows Azure Web Sites
Today’s official Visual Studio 2013 launch provides some interesting novelties, especially for Windows Azure Web Sites. There is now the choice of choosing which pipeline to run in (classic or integrated), we can define separate applications in subfolders of our web site, debug a web site right from within Visual Studio. But the most impressive one is this. How about… an in-browser editor for your application? Let’s take a quick tour of it. After creating a web site we can go to the web site’s configuration we can enable the Visual Studio Online preview. Once enabled, simply navigate to .scm.azurewebsites.net/dev">https://<yoursitename>.scm.azurewebsites.net/dev or click the link from the dashboard, provide your site credentials and be greeted with Visual Studio Online.
-
Developing Windows Azure Mobile Services server-side
Word of warning: This is a partial cross-post from the JetBrains WebStorm blog. The post you are currently reading adds some more information around Windows Azure Mobile Services and builds on a full example and is a bit more in-depth. With Microsoft’s Windows Azure Mobile Services, we can build a back-end for iOS, Android, HTML, Windows Phone and Windows 8 apps that supports storing data, authentication, push notifications across all platforms and more. There are client libraries available for all these platforms which can be used when developing in an IDE of choice, e.g. AppCode, Google Android Studio or Visual Studio. In this post, let’s focus on what these different platforms have in common: the server-side code.
-
Using the Windows Azure Content Delivery Network (CDN)
With the Windows Azure Content Delivery Network (CDN) released as a preview, I thought it was a good time to write up some details about how to work with it. The CDN can be used for offloading content to a globally distributed network of servers, ensuring faster throughput to your end users. Note: this is a modified and updated version of my article at ACloudyPlace.com roughly two years ago. I have added information on how to work with ASP.NET MVC bundling and the Windows Azure CDN, updated screenshots and so on.
-
An autoscaling build farm using TeamCity and Windows Azure
Cloud computing is often referred to as a cost saver due to its billing models. If we can move workloads that are seasonal to the cloud, cost reduction is something that will come. No matter if it’s really “seasonal seasonal” (e.g. a temporary high workload around the holidays) or “daily seasonal” where workloads are different depending on the time of day, these workloads have written cloud all over them.
-
Just released: MvcSiteMapProvider 4.0
After a beta version about a month ago, we are proud to release MvcSiteMapProvider 4.0 stable! (get it from NuGet, it’s fresh!) It took 6 months to complete this major version but I think our GitHub contributors have done a great job. Thank you all and especially Shad for taking the lead on this release!
-
Windows Azure Traffic Manager Explained
With yesterday’s announcement on Windows Azure Traffic Manager surfacing in the management portal (as a preview), I thought it was a good moment to recap this more than 2 year old service. Windows Azure Traffic Manager allows you to control the distribution of network traffic to your Cloud Services and VMs hosted within Windows Azure. The Windows Azure Traffic Manager provides several methods of distributing internet traffic among two or more cloud services or VMs, all accessible with the same URL, in one or more Windows Azure datacenters. At its core, it is basically a distributed DNS service that knows which Windows Azure services are sitting behind the traffic manager URL and distributes requests based on three possible profiles:
-
Autoscaling Windows Azure Cloud Services (and web sites)
At the Build conference, Microsoft today announced that Windows Azure Cloud Services now support autoscaling. And they do! From the Windows Azure Management Portal, we can use the newly introduced SCALE tab to configure autoscaling. That’s right: some configuration and we can select the range of instances we want to have. Windows Azure does the rest. And this is true for both Cloud Services and Standard Web Sites (formerly known as Reserved instances). We can add various rules in the autoscaler: A long awaited feature is there! I'll enable this for some services and see how it goes...
-
Enabling PHP 5.5 on Windows Azure Web Sites using a remote shell and KuduExec
While probably this post will be outdated in the coming days, at the time of writing Windows Azure Web Sites has no PHP 5.5 support (again: yet). In this post, we’ll explore how to enable PHP 5.5 on Windows Azure Web Sites ourselves. Last year my friend Cory wrote a post on enabling PHP 5.4 in Windows Azure Web Sites which applies to PHP 5.5 as well. However I want to discuss a different approach. And do read on if PHP 5.5 is already officially available on WAWS: there are some tips and tricks in here.
-
And there it is - MvcSiteMapProvider v4 (beta)
It has been a while since a new major update has been done to the MvcSiteMapProvider project, but today is the day! MvcSiteMapProvider is a tool that provides flexible menus, breadcrumb trails, and SEO features for the ASP.NET MVC framework, similar to the ASP.NET SiteMapProvider model. To be honest, I have not done a lot of work. Thanks to the power of open source (and Shad who did a massive job on refactoring the whole, thanks!), MvcSiteMapProvider v4 is around the corner. A lot of things have changed. And by a lot, I mean A LOT! The most important change is that we’ve stepped away from the ASP.NET SiteMapProvider dependency. This has been a massive pain in the behind and source of a lot of issues. Whereas I initially planned on ditching this dependency with v3, it happened now anyway.
-
Create a list of favorite ReSharper plugins
With the latest version of the ReSharper 8 EAP, JetBrains shipped an extension manager for plugins, annotations and settings. Where it previously was a hassle and a suboptimal experience to install plugins into ReSharper, it’s really easy to do now. And what is really nice is that this extension manager is built on top of NuGet! Which means we can do all sorts of tricks… The first thing that comes to mind is creating a personal NuGet feed containing just those plugins that are of interest to me. And where better to create such feed than MyGet? Create a new feed, navigate to the Package Sources pane and add a new package source. There’s a preset available for using the ReSharper extension gallery!
-
Using Amazon Login (and LinkedIn and …) with Windows Azure Access Control
One of the services provided by the Windows Azure cloud computing platform is the Windows Azure Access Control Service (ACS). It is a service that provides federated authentication and rules-driven, claims-based authorization. It has some social providers like Microsoft Account, Google Account, Yahoo! and Facebook. But what about the other social identity providers out there? For example the newly introduced Login with Amazon, or LinkedIn? As they are OAuth2 implementations they don’t really fit into ACS.
-
Throttling ASP.NET Web API calls
Many API’s out there, such as GitHub’s API, have a concept called “rate limiting” or “throttling” in place. Rate limiting is used to prevent clients from issuing too many requests over a short amount of time to your API. For example, we can limit anonymous API clients to a maximum of 60 requests per hour whereas we can allow more requests to authenticated clients. But how can we implement this? Just like ASP.NET MVC, ASP.NET Web API allows us to write action filters. An action filter is an attribute that you can apply to a controller action, an entire controller and even to all controllers in a project. The attribute modifies the way in which the action is executed by intercepting calls to it. Sound like a great approach, right?
-
SymbolSource support for NuGet Package Source Discovery
A couple of weeks, I told you about NuGet Package Source Discovery. In short, it allows you to add some meta information to your website and use your website as a discovery document for NuGet feeds. And thanks to a contribution to the spec by Marcin from SymbolSource.org, Package Source Discovery (PSD) now supports configuring Visual Studio for consuming symbols as well. Nifty! Let’s go with an example. If we discover packages from my blog, some feeds will be added to NuGet in Visual Studio. Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ —>1 Install-Package DiscoverPackageSources 2 Discover-PackageSources -Url "" Because my blog links to my feeds on MyGet, I can provide my MyGet credentials with it:
-
Running unit tests when deploying ASP.NET to Windows Azure Web Sites
One of the well-loved features of Windows Azure Web Sites is the fact that you can simply push our ASP.NET application’s source code to the platform using Git (or TFS or DropBox) and that sources are compiled and deployed on your Windows Azure Web Site. If you’ve checked the management portal earlier, you may have noticed that a number of deployment steps are executed: the deployment process searches for the project file to compile, compiles it, copies the build artifacts to the web root and has your website running. But did you know you can customize this process? [update] Mstest seems to work now as well, using the console runner from VS2012.
-
NuGet Package Source Discovery
It’s already been 2 years since NuGet was introduced. This.NET package manager features the concept of feeds, or “package sources”, on which packages containing .NET libraries and tools can be hosted. In fact, support for feeds inspired us to build www.myget.org. While not all people are aware of this, Microsoft started out with two feeds as well: one for www.nuget.org, the other one for the Orchard CMS. More and more feeds are being created daily, both by Microsoft as well as others. Here’s a list of feeds Microsoft has that I know of (there are probably more):
-
Remote profiling Windows Azure Cloud Services with dotTrace
Here’s another cross-post from our JetBrains .NET blog. It’s focused around dotTrace but there are a lot of tips and tricks around Windows Azure Cloud Services in it as well, especially around working with the load balancer. Enjoy the read! With dotTrace Performance, we can profile applications running on our local computer as well as on remote machines. The latter can be very useful when some performance problems only occur on the staging server (or even worse: only in production). And what if that remote server is a Windows Azure Cloud Service?
-
Custom media types for ASP.NET Web API versioning
There is a raging discussion on the interwebs on whether to version API’s by using their URL or by using a custom media type. Some argue that doing it in the URL breaks REST (since a different URL is a different resource while versions don’t necessarily mean a new resource is available). While I still feel good about both approaches, I guess it depends on the domain you are working with.
-
Taking over the @msdnbelux Twitter account
Just a quick post to let you know I’ll be taking over the @msdnbelux Twitter account for the next two weeks. This is the official Twitter account for MSDN BeLux. It’s not hacked, I did not steal the password: they gave it to me! The best thing about this takeover is that there are no constraints: I can tweet whatever I want to tweet! So far it's been fun to do, I've seen a lot of reactions on my tweets as well. Let me know how I do! Who knows, I might just change the password and keep this account for myself after these two weeks :-) Follow @msdnbelux and I’ll provide you with great ASP.NET MVC, ASP.NET Web API, JavaScript and Windows Azure related content. Enjoy!
-
Working with Windows Azure SQL Database in PhpStorm
Disclaimer: My job at JetBrains holds a lot of “exploration of tools”. From time to time I discover things I personally find really cool and blog about those on the JetBrains blogs. If it relates to Windows Azure, I typically cross-post on my personal blog. PhpStorm provides us the possibility to connect to Windows Azure SQL Database right from within the IDE. In this post, we’ll explore several options that are available for working with Windows Azure SQL Database (or database systems like SQL Server, MySQL, PostgreSQL or Oracle, for that matter): If you are familiar with Windows Azure SQL Database, make sure to configure the database firewall correctly so you can connect to it from your current machine.
-
Global Windows Azure Bootcamp - april 27th
On April 27th, 2013, you’ll have the ability to join a Windows Azure Bootcamp on a location close to you. We’ve started this with the idea of maybe having 10 or 15 locations world wide. We were wrong. Here’s what happened: In short: we now have over 50 locations available where a bootcamp will be organized! This one day deep dive class will get you up to speed on developing for Windows Azure. The class includes a trainer with deep real world experience with Windows Azure, as well as a series of labs so you can practice what you just learned. It’s free, so find your location and join the fun!
-
Running unit tests when deploying to Windows Azure Web Sites
When deploying an application to Windows Azure Web Sites, a number of deployment steps are executed. For .NET projects, msbuild is triggered. For node.js applications, a list of dependencies is restored. For PHP applications, files are copied from source control to the actual web root which is served publicly. Wouldn’t it be cool if Windows Azure Web Sites refused to deploy fresh source code whenever unit tests fail? In this post, I’ll show you how. Disclaimer: I’m using PHP and PHPUnit here but the same approach can be used for node.js. .NET is a bit harder since most test runners out there are not supported by the Windows Azure Web Sites sandbox. I’m confident however that in the near future this issue will be resolved and the same technique can be used for .NET applications.
-
Hosting a YouTrack instance on Windows Azure
Note: this is a cross-post from the JetBrains YouTrack blog. Since it is centered around Windows Azure, I thought it is appropriate to post a copy on my own blog as well. YouTrack, JetBrains’ agile issue tracker, can be installed on different platforms. There is a stand-alone version which can be downloaded and installed on your own server. If you prefer a cloud-hosted solution there’s YouTrack InCloud available for you. There is always a third way as well: why not host YouTrack stand-alone on a virtual machine hosted in Windows Azure? In this post we’ll walk you through getting a Windows Azure subscription, creating a virtual machine, installing YouTrack and configuring firewalls so we can use our cloud-hosted YouTrack instance from any browser on any location.
-
Tales from the trenches: resizing a Windows Azure virtual disk the smooth way
We’ve all been there. Running a virtual machine on Windows Azure and all of a sudden you notice that a virtual disk is running full. Having no access to the hypervisor nor to its storage (directly), there’s no easy way out… Big disclaimer: use the provided code on your own risk! I’m not responsible if something breaks! The provided code is as-is without warranty! I have tested this on a couple of data disks without any problems. I've tested this on OS disks and this sometimes works, sometimes fails. Be warned. Download/contribute: on GitHub When searching for a solution to this issue,the typical solution you’ll find is the following:
-
Working with Windows Azure command line tools from within Visual Studio
Right after my last post (Working with Windows Azure command line tools from PhpStorm), the obvious question came to mind… Can I do Windows Azure things using the command line tools from within Visual Studio as well? Sure you can! At least if you have the NuGet Package Manager Console installed into your Visual Studio. For good order: you can use either the PowerShell cmdlets that are available or use the Node-based tools available (how-to). In this post we’ll be using the PowerShell cmdlets. And once those are installed… there’s nothing you have to do to get these working in Visual Studio!
-
Working with Windows Azure from within PhpStorm
Working with Windows Azure and my new toy (PhpStorm), I wanted to have support for doing specific actions like creating a new web site or a new database in the IDE. Since I’m not a Java guy, writing a plugin was not an option. Fortunately, PhpStorm (or WebStorm for that matter) provide support for issuing commands from the IDE. Which led me to think that it may be possible to hook up the Windows Azure Command Line Tools in my IDE… Let’s see what we can do… First of all, we’ll need the ‘azure’ tools. These are available for download for Windows or Mac. If you happen to have Node and NPM installed, simply issue npm install azure-cli -g and we’re good to go.
-
Windows Azure Websites and PhpStorm
In my new role as Technical Evangelist at JetBrains, I’ve been experimenting with one of our products a lot: PhpStorm. I was kind of curious how this tool would integrate with Windows Azure Web Sites. Now before you quit reading this post because of that acronym: if you are a Node-head you can also use WebStorm to do the same things I will describe in this post. Let’s see if we can get a simple PHP application running on Windows Azure right from within our IDE… Let’s go through setting up a Windows Azure Web Site real quickly. If this is the first time you hear about Web Sites and want more detail on getting started, check the Windows Azure website for a detailed step-by-step explanation.
-
Storing user uploads in Windows Azure blob storage
On one of the mailing lists I follow, an interesting question came up: “We want to write a VSTO plugin for Outlook which copies attachments to blob storage. What’s the best way to do this? What about security?”. Shortly thereafter, an answer came around: “That can be done directly from the client. And storage credentials can be encrypted for use in your VSTO plugin.” While that’s certainly a solution to the problem, it’s not the best. Let’s try and answer… The first solution that comes to mind is implementing the following flow: the client authenticates and uploads data to your service which then stores the upload on blob storage.
-
Protecting your ASP.NET Web API using OAuth2 and the Windows Azure Access Control Service
An article I wrote a while ago has been posted on DeveloperFusion: The world in which we live evolves at a vast speed. Today, many applications on the Internet expose an API which can be consumed by everyone using a web browser or a mobile application on their smartphone or tablet. How would you build your API if you want these apps to be a full-fledged front-end to your service without compromising security? In this article, I’ll dive into that. We’ll be using OAuth2 and the Windows Azure Access Control Service to secure our API yet provide access to all those apps out there.
-
Configuring IIS methods for ASP.NET Web API on Windows Azure Websites and elsewhere
That’s a pretty long title, I agree. When working on my implementation of RFC2324, also known as the HyperText Coffee Pot Control Protocol, I’ve been struggling with something that you will struggle with as well in your ASP.NET Web API’s: supporting additional HTTP methods like HEAD, PATCH or PROPFIND. ASP.NET Web API has no issue with those, but when hosting them on IIS you’ll find yourself in Yellow-screen-of-death heaven.
-
How I push GoogleAnalyticsTracker to NuGet
If you check my blog post Tracking API usage with Google Analytics, you’ll see that a small open-source component evolved from MyGet. This component, GoogleAnalyticsTracker, lives on GitHub and NuGet and has since evolved into something that supports Windows Phone and Windows RT as well. But let’s not focus on the open-source aspect. It’s funny how things evolve. GoogleAnalyticsTracker started as a small component inside MyGet, and since a couple of weeks it uses MyGet to publish itself to NuGet. Say what? In this blog post, I’ll elaborate a bit on the development tools used on this tiny component.
-
A phone call from the cloud: Windows Azure, SignalR & Twilio
Note: this blog post used to be an article for the Windows Azure Roadtrip website. Since that one no longer exists, I decided to post the articles on my blog as well. Find the source code for this post here: 05 ConfirmPhoneNumberDemo.zip (1.32 mb). It has been written earlier this year, some versions of packages used (like jQuery or SignalR) may be outdated in this post. Live with it.
-
Sending e-mail from Windows Azure
Note: this blog post used to be an article for the Windows Azure Roadtrip website. Since that one no longer exists, I decided to post the articles on my blog as well. Find the source code for this post here: 04 SendingEmailsFromTheCloud.zip (922.27 kb). When a user subscribes, you send him a thank-you e-mail. When his account expires, you send him a warning message containing a link to purchase a new subscription. When he places an order, you send him an order confirmation. I think you get the picture: a fairly common scenario in almost any application is sending out e-mails.
-
(Almost) time for something new...
September 1st, 2005. Fresh from school, I got the opportunity to start at RealDolmen (Dolmen, back then). Not just a “welcome, here’s your customer, cya!”-start, but a start where my fresh colleagues and I got a 4 months deep dive from people in the industry. Entirely different from what school taught me, focused “on the job”. 4 months later, I started at my first customer, then the second, third, a project developed in-house, did some TFS customizations, some Windows Azure, …
-
From API key to user with ASP.NET Web API
ASP.NET Web API is a great tool to build an API with. Or as my buddy Kristof Rennen (and the French) always say: “it makes you ‘api”. One of the things I like a lot is the fact that you can do very powerful things that you know and love from the ASP.NET MVC stack, like, for example, using filter attributes. Action filters, result filters and… authorization filters. Say you wanted to protect your API and make use of the controller’s User property to return user-specific information. You probably will add an [Authorize] attribute (to ensure the user is authenticated) to either the entire API controller or to one of its action methods, like this: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/
-
What PartitionKey and RowKey are for in Windows Azure Table Storage
For the past few months, I’ve been coaching a “Microsoft Student Partner” (who has a great blog on Kinect for Windows by the way!) on Windows Azure. One of the questions he recently had was around PartitionKey and RowKey in Windows Azure Table Storage. What are these for? Do I have to specify them manually? Let’s explain… All Windows Azure storage abstractions (Blob, Table, Queue) are built upon the same stack (whitepaper here). While there’s much more to tell about it, the reason why it scales is because of its partitioning logic. Whenever you store something on Windows Azure storage, it is located on some partition in the system. Partitions are used for scale out in the system. Imagine that there’s only 3 physical machines that are used for storing data in Windows Azure storage:
-
MyGet Build Services - Join the private beta!
Good news! Over the past 4 weeks we’ve been sending out tweets about our secret project MyGet project “wonka”. Today is the day Wonka shows his great stuff to the world… In short: MyGet Build Services enable you to add packages to your feed by just giving us your GitHub repo. We build it, we package it, we publish it. Our build server searches for a file called MyGet.sln and builds that. No probem if it's not there: we'll try and build other projects then. We'll run unit tests (NUnit, XUnit, MSTest and some more) and fail when those fail. We'll search for packages generated by your solution and if none are generated, we take a wild guess and create them for you.
-
Get your Windows 8 up to speed fast
With the release of Windows 8 on MSDN yesterday, I have a gut feeling that today, around the globe, people are installing this fresh operating system on their machine. I’ve done so too and I wanted to share with your two tools: one that helped me get up to speed fast, one that will help me up to speed even faster the next time I want to reset my PC. One of the best things created for Windows, ever, is Chocolatey. If you are familiar with Ninite, you will find that both serve the same purpose, however Chocolatey is more developer focused.
-
ASP.NET Web API OAuth2 delegation with Windows Azure Access Control Service
If you are familiar with OAuth2’s protocol flow, you know there’s a lot of things you should implement if you want to protect your ASP.NET Web API using OAuth2. To refresh your mind, here’s what’s required (at least): That’s a lot to build there. Wouldn’t it be great to outsource part of that list to a third party? A little-known feature of the Windows Azure Access Control Service is that you can use it to keep track of applications, user consent and token expiration & refresh token handling. That leaves you with implementing: Let’s do it!
-
Hands-on Windows Azure Services for Windows
A couple of weeks ago, Microsoft announced their Windows Azure Services for Windows Server. If you’ve ever heard about the Windows Azure Appliance (which is vaporware imho :-)), you’ll be interested to see that the Windows Azure Services for Windows Server are in fact bringing the Windows Azure Services to your datacenter. It’s still a Technical Preview, but I took the plunge and installed this on a bunch of virtual machines I had lying around. In this post, I’ll share you with some impressions, ideas, pains and speculations.
-
Tweaking Windows Azure Web Sites
A while ago, I was at a customer who wanted to run his own WebDAV server (using www.sabredav.org) on Windows Azure Web Sites. After some testing, it seemed that this PHP-based WebDAV server was missing some configuration at the webserver level. Some HTTP keywords required for the WebDAV protocol were not mapped to the PHP runtime making it virtually impossible to run a custom WebDAV implementation on PHP. Unless there’s some configuration possible… I’ve issued a simple phpinfo(); on Windows Azure Websites, simply outputting the PHP configuration and all available environment variables in Windows Azure Websites. This revealed the following interesting environment variable:
-
Community guidelines to stay out of the busy trap
For the past few days, an interesting blog post on the NY Times has been popping up in my Twitter timeline. In your as well, probably, since almost everyone I know has retweeted it a couple of times. Which blog post? The one about the so-called “busy trap”. The idea is simple: we’re all caught in the busy trap. Everyone feels busy, runs their life and activities at 200%. Here’s a great summary from the blog post:
-
Fourth year as an MVP, second year for Windows Azure
Woohoo! I just received the great mail I expect yearly on the first of July: Dear Maarten Balliauw, Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Windows Azure technical communities during the past year. The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership." Toby Richards General Manager Community & Online Support
-
Domain based routing with ASP.NET Web API
Imagine you are building an API which is “multi-tenant”: the domain name defines the tenant or customer name and should be passed as a route value to your API. An example would be http://customer1.mydomain.com/api/v1/users/1. Customer 2 can use the same API, using http://customer2.mydomain.com/api/v1/users/1. How would you solve routing based on a (sub)domain in your ASP.NET Web API projects? Almost 2 years ago (wow, time flies), I’ve written a blog post on ASP.NET MVC Domain Routing. Unfortunately, that solution does not work out-of-the-box with ASP.NET Web API. The good news is: it almost works out of the box. The only thing required is adding one simple class: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/
-
Setting up a webfarm using Windows Azure Virtual Machines
With the release of Microsoft’s Windows Azure Virtual Machines, a bunch of new scenarios became available on their cloud platform. If you plan to host multiple web applications, you can either go with Windows Azure Web Sites or go with a webfarm you create using the new IaaS capabilities. The first is okay for any type of application, the latter may be suitable when running a large-scale web application that can not be deployed easily in the PaaS offering. In this blog post, I’ll show you how to build a webfarm with (free!) load balancing.
-
Use NuGet Package Restore to avoid pushing assemblies to Windows Azure Websites
Windows Azure Websites allows you to publish a web site in ASP.NET, PHP, Node, … to Windows Azure by simply pushing your source code to a TFS or Git repository. But how does Windows Azure Websites manage dependencies? Do you have to check-in your assemblies and NuGet packages into source control? How about no… NuGet 1.6 shipped with a great feature called NuGet Package Restore. This feature lets you use NuGet packages without adding them to your source code repository. When your solution is built by Visual Studio (or MSBuild, which is used in Windows Azure Websites), a build target calls nuget.exe to make sure any missing packages are automatically fetched and installed before the code is compiled. This helps you keep your source repo small by keeping large packages out of version control.
-
GitHub for Windows Azure Websites
With the new release of Windows Azure and Windows Azure Websites, a lot of new scenarios with Windows Azure just became possible. One I like a lot, especially since Appharbor and Heroku have similar offers too, is the possibility to push source code (ASP.NET or PHP) to Windows Azure instead of binaries using Windows Azure Websites. Not everyone out there is a command-line here though: if you want to use Git as a mechanism of pushing sources to Windows Azure Websites chances are you may go crazy if you are unfamiliar with command-line git commands. Luckily, a couple of weeks ago, GitHub released GitHub for Windows. It features an easy-to-use GUI on top of GitHub repositories. And with a small trick also on top of Windows Azure Websites.
-
AZUG Windows Azure Saturday overview
As one of the board members of the Windows Azure User Group in Belgium, I wanted to write a post on an event we organized last weekend. We do more events (one each month), however this one was way out of our comfort zone. Typically, we have an evening event in which a speaker delivers one session to around 40 attendees. Last Saturday, we organized our first Windows Azure Saturday, a hackaton followed by a barbecue. Here’s what I will remember about our event… The idea for a “hackaton plus barbecue” emerged a couple of months ago. The idea was simple: get a group of Windows Azure enthusiasts together, code for a couple of hours and have a fun barbecue afterwards.
-
Ready for a Windows Azure roadtrip?
A while ago, Michelangelo van Dam (a hardcore PHP guy), François Hertay (a hardcore Java guru) and myself (a .NET guy) were asked if we wanted to write about some of our experiences with the Windows Azure platform. Starting next week, you’ll find about 3 blog posts per week and/or videos on Windows Azure (both a getting started level as well as some fun advanced posts) on a freshly released website: www.azure-roadtrip.be. I have the honour of kicking off a series of blog posts on .NET, starting with a level 100 one: the what & why of Windows Azure for .NET developers.
-
Social meet up on Twitter for MEET Windows Azure on June 7th
Here’s a perhaps rather redundant event for you but it should be kind of fun: MEET Windows Azure on Twitter (+ Beer). The idea is to list people who have a twitter account and intend to follow the MEET Windows Azure event via live streaming on June 7th (1pm PDT). So see you online for the event on the 7th! My Twitter handle is @maartenballiauw MEET Windows Azure Blog Relay: + Beer? Since you are watching the event from your coucnh (or the totilet, or your bed, or actually, from wherever you want), feel free to open up a beer. Call to action: Link to this blog post on your blog and I will update this post to link to you!
-
The world is changing: the future of IT
I’ve had my say on cloud and the new world of IT already in an earlier post, Predictions for the future. Today, I’m seeing signs the world is in fact starting to change. Sites like Instagram started small and grew big in no time. Were the founders IT wonders? No. And you don’t have to be. Not so long ago, it would have taken you a lot of time and resources to get your idea up and running on the Internet. Especially if it required multiple datacenters and scalability. You would have to deploy a bunch of servers and make sure you had an agile IT environment in place in order to get things running and keep things flexible, a key requirement for many startups but also for large organizations.
-
Using the Windows Azure Content Delivery Network
As you know, Windows Azure is a very rich platform. Next to compute and storage, it offers a series of building blocks that simplify your life as a cloud developer. One of these building blocks is the content delivery network (CDN), which can be used for offloading content to a globally distributed network of servers, ensuring faster throughput to your end users. I’ve been asked to write an article on this matter, which I did, and which is live at ACloudyPlace.com since today. As a small teaser, here’s the first section of it:
-
Protecting Windows Azure Web and Worker roles from malware
Most IT administrators will install some sort of virus scanner on your precious servers. Since the cloud, from a technical perspective, is just a server, why not follow that security best practice on Windows Azure too? It has gone by almost unnoticed, but last week Microsoft released the Microsoft Endpoint Protection for Windows Azure Customer Technology Preview. For the sake of bandwidth, I’ll be referring to it as EP. EP offers real-time protection, scheduled scanning, malware remediation (a fancy word for quarantining), active protection and automatic signature updates. Sounds a lot like Microsoft Endpoint Protection or Windows Security Essentials? That’s no coincidence: EP is a Windows Azurified version of it.
-
Pro NuGet is finally there!
Short version: Install-Package ProNuget or http://amzn.to/pronuget It’s been a while since I wrote my first book. After I’ve been telling that writing a book is horrendous (try writing a chapter per week after your office hours…) and that I would never write on again, my partner-in-crime Xavier Decoster and I had the same idea at the same time: what about a book on NuGet? So here it is: Pro NuGet is fresh off the presses (or on Kindle). Special thanks go out to Scott Hanselman and Phil Haack for writing our foreword. Also big kudos to all who’ve helped us out now and then and did some small reviews. Yes Rob, Paul, David, Phil, Hadi: that’s you guys.
-
I’m an ASP Insider
Cool! I’ve just learned that I’m invited to join the ASPInsiders. I’m really excited and honored to be part of this group of great ASP.NET experts. Very much looking forward to learning the secret handshake and being able to provide feedback that helps the ASP.NET team forward. If don’t know who the ASP Insiders are, here’s their elevator pitch: “The ASPInsiders is a select group of international professionals who have demonstrated expertise in ASP.NET technologies and who provide valuable, early feedback on related developing technologies and publications to their peers, the Microsoft ASP.NET team and others.” Some more info is available in the Who are the ASPInsiders? post by one of the insiders.
-
TechDays Finland - Architectural Patterns for the Cloud - NuGet
As promised, here are the slide decks for the two sessions delivered at TechDays Finland last week. The promise of all cloud vendors out there is they can run your applications without changes. While that claim is true, it’s better to optimize existing software or design specifically for the cloud when moving or building an application. Architectural optimization will speed up your application, make it more scalable and even will make it cheaper to run on Windows Azure. This session will take you along some common patterns that are easy to implement and will make your cloud more sunny.
-
Introducing MyGet package source proxy (beta)
My blog already has quite the number of blog posts around MyGet, our NuGet-as-a-Service solution which my colleague Xavier and I are running. There are a lot of reasons to host your own personal NuGet feed (such as protecting your intellectual property or only adding approved packages to the feed, but there’s many more as you can <plug>read in our book</plug>). We’ve added support for another scenario: MyGet now supports proxying remote feeds.
-
Slides for TechDays Belgium 2012: SignalR
It was the last session on the last day of TechDays 2012 so I was expecting almost nobody to show up. Still, a packed room came to have a look at how to make the web realtime using SignalR. Thanks for joining and for being very cooperative during the demos! As promised, here are the slides. You can also find the demo code here: SignalR. Code, not toothpaste - TechDays Belgium 2012.zip (2.74 mb) A recording on Channel9 is available as well. PS: The book on NuGet (Pro NuGet) which I mentioned can be (pre)ordered on Amazon.
-
Slides for UGIALT.NET - SignalR
Except for having a bad, bad experience using EasyJet on the way towards Milan, UGIALT.NET was a blast! Here's the slide deck and sample code for my session on SignalR.
-
Tracking API usage with Google Analytics
So you have an API. Congratulations! You should have one. But how do you track who uses it, what client software they use and so on? You may be logging API calls yourself. You may be relying on services like Apigee.com who make you pay (for a great service, though!). Being cheap, we thought about another approach for MyGet. We’re already using Google Analytics to track pageviews and so on, why not use Google Analytics for tracking API calls as well? Meet GoogleAnalyticsTracker. It is a three-classes assembly which allows you to track requests from within C# to Google Analytics. Go and fork this thing and add out-of-the-box support for WCF Web API, Nancy or even “plain old” WCF or ASMX!
-
Don’t brag about your Visual Studio achievements! (yet?)
The Channel 9 folks seem to have released the first beta of their Visual Studio Achievements project. The idea of Visual Studio Achievements is pretty awesome: Bring Some Game To Your Code! A software engineer’s glory so often goes unnoticed. Attention seems to come either when there are bugs or when the final project ships. But rarely is a developer appreciated for all the nuances and subtleties of a piece of code–and all the heroics it took to write it. With Visual Studio Achievements Beta, your talents are recognized as you perform various coding feats, unlock achievements and earn badges. Find the announcement here and the beta from the Visual Studio Gallery here.
-
How do you synchronize a million to-do lists?
Not this question, but a similar one, has been asked by one of our customers. An interesting question, isn’t it? Wait. It gets more interesting. I’ll sketch a fake scenario that’s similar to our customer’s question. Imagine you are building mobile applications to manage a simple to-do list. This software is available on Android, iPhone, iPad, Windows Phone 7 and via a web browser. One day, the decision to share to-do lists has been made. Me and my wife should be able to share one to-do list between us, having an up-to-date version of the list on every device we grant access to this to-do list. Now imagine there are a million of those groups, where every partner in the sync relationship has the latest version of the list on his device. In often a disconnected world. How would you solve this?
-
Predictions for the future
It’s almost the end of 2011. Typically a time where bloggers start to write about their past year and what they’ll do in the next. A time where the Forrester, Gartner and McKinsey-alikes make predictions about next year. I know, normally I blog about technology in its technological sense, but today I feel like blogging about my vision on the future. Not 2012, but the future. And the present. Here’s my story in which I try to capture todays world and how this will influence technology.
-
Using SignalR to broadcast a slide deck
Last week, I’ve discussed Techniques for real-time client-server communication on the web (SignalR to the rescue). We’ve seen that when building web applications, you often face the fact that HTTP, the foundation of the web, is a request/response protocol. A client issues a request, a server handles this request and sends back a response. All the time, with no relation between the first request and subsequent requests. Also, since it’s request-based, there is no way to send messages from the server to the client without having the client create a request first.
-
Techniques for real-time client-server communication on the web (SignalR to the rescue)
When building web applications, you often face the fact that HTTP, the foundation of the web, is a request/response protocol. A client issues a request, a server handles this request and sends back a response. All the time, with no relation between the first request and subsequent requests. Also, since it’s request-based, there is no way to send messages from the server to the client without having the client create a request first.
-
Repaving your PC: the easier way
It"’s been a while since I had to repave my laptop. I have a Windows Home Server (WHS) at home which images my PC almost daily and allows restoring it to a given point in time in less than 30 minutes. Which is awesome! And which is how I usually “restore” my PC into a stable state. Over the past year some hardware changes have been made of which the most noteworthy is the replacement of the existing hard drive with an SSD. A great addition, and it was easy to restore as well: swap the disks and restore the image from WHS. SSD and full system install? 30 minutes.
-
Publishing symbol packages for a MyGet feed
Ever since NuGet 1.2, there is a great way for NuGet package authors to let their users debug into the package’s binaries. With almost no additional effort, package authors can publish their symbols and sources, and package consumers can debug into them from Visual Studio, simply by pushing a symbols package in addition to the standard NuGet package. Today, we’re proud to announce MyGet has partnered with SymbolSource.org to offer an easy workflow to publish symbol packages for a private MyGet feed. This means from now on you can publish symbol packages for your private feeds as well!
-
Rewriting WCF OData Services base URL with load balancing & reverse proxy
When scaling out an application to multiple servers, often a form of load balancing or reverse proxying is used to provide external users access to a web server. For example, one can be in the situation where two servers are hosting a WCF OData Service and are exposed to the Internet through either a load balancer or a reverse proxy. Below is a figure of such setup using a reverse proxy. As you can see, the external server listens on the URL www.example.com, while both internal servers are listening on their respective host names. Guess what: whenever someone accesses a WCF OData Service through the reverse proxy, the XML generated by one of the two backend servers is slightly invalid:
-
Running Memcached on Windows Azure for PHP
After three conferences in two weeks with a lot of “airport time”, which typically converts into “let’s code!” time, I think I may have tackled a commonly requested Windows Azure feature for PHP developers. Some sort of distributed caching is always a great thing to have when building scalable services and applications. While Windows Azure offers a distributed caching layer under the form of the Windows Azure Caching, that components currently lacks support for non-.NET technologies. I’ve heard there’s work being done there, but that’s not very interesting if you are building your app today. This blog post will show you how to modify a Windows Azure deployment to run and use Memcached in the easiest possible manner.
-
Setting up a NuGet repository in seconds: MyGet public feeds
A few months ago, my colleague Xavier Decoster and I introduced MyGet as a tool where you can create your own, private NuGet feeds. A couple of weeks later we introduced some options to delegate feed privileges to other MyGet users allowing you to make another MyGet user “co-admin” or “contributor” to a feed. Since then we’ve expanded our view on the NuGet ecosystem and moved MyGet from a solution to create your private feeds to a service that allows you to set up a NuGet feed, whether private or public. Supporting public feeds allows you to set up a structure similar to www.nuget.org: you can give any user privileges to publish a package to your feed while the user can never manage other packages on your feed. This is great in several scenarios:
-
NuGet push... to Windows Azure
When looking at how people like to deploy their applications to a cloud environment, a large faction seems to prefer being able to use their source control system as a source for their production deployment. While interesting, I see a lot of problems there: your source code may not run immediately and probably has to be compiled. You don’t want to maintain compiled assemblies in source control, right? Also, maybe some QA process is in place where a deployment can only occur after approval. Why not use source control for what it’s there for: source control? And how about using a NuGet repository as the source for our deployment? Meet the Windows Azure NuGetRole. Disclaimer/Warning: this is demo material and should probably not be used for real-life deployments without making it bullet proof!
-
ASP.NET MVC dynamic view sections
Earlier today, a colleague of mine asked for advice on how he could create a “dynamic” view. To elaborate, he wanted to create a change settings page on which various sections would be rendered based on which plugins are loaded in the application. Intrigued by the question and having no clue on how to do this, I quickly hacked together a SettingsViewModel, to which he could add all section view models no matter what type they are: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ —>1 public class SettingsViewModel 2 { 3 public List<dynamic> SettingsSections = new List<dynamic>(); 4 }
-
Why MyGet uses Windows Azure
Recently one of the Tweeps following me started fooling around and hit one of my sweet spots: Windows Azure. Basically, he mocked me for using Windows Azure for MyGet, a website with enough users but not enough to justify the “scalability” aspect he thought Windows Azure was offering. Since Windows Azure is much, much more than scalability alone, I decided to do a quick writeup about the various reasons on why we use Windows Azure for MyGet. And those are not scalability. First of all, here’s a high-level overview of our deployment, which may illustrate some of the aspects below:
-
Book review: Microsoft Windows Azure Development Cookbook
Over the past few months, I’ve been doing technical reviewing for a great Windows Azure book: the Windows Azure Development Cookbook published by Packt. During this review I had no idea who the author of the book was but after publishing it seems the author is no one less than my fellow Windows Azure MVP Neil Mackenzie! If you read his blog you should know you should immediately buy this book. Why? Well, Neil usually goes both broad and deep: all required context for understanding a recipe is given and the recipe itself goes deep enough to know most of the ins and outs of a specific feature of Windows Azure. Well written, to the point and clear to every reader both novice and expert.
-
A client side Glimpse to your PHP application
A few months ago, the .NET world was surprised with a magnificent tool called “Glimpse”. Today I’m pleased to release a first draft of a PHP version for Glimpse! Now what is this Glimpse thing… Well: "what Firebug is for the client, Glimpse does for the server... in other words, a client side Glimpse into whats going on in your server." For a quick demonstration of what this means, check the video at http://getglimpse.com/. Yes, it’s a .NET based video but the idea behind Glimpse for PHP is the same. And if you do need a PHP-based one, check http://screenr.com/27ds (warning: unedited :-)) Fundamentally Glimpse is made up of 3 different parts, all of which are extensible and customizable for any platform:
-
Version 4 of the Windows Azure SDK for PHP released
Only a few months after the Windows Azure SDK for PHP 3.0.0, Microsoft and RealDolmen are proud to present you the next version of the most complete SDK for Windows Azure out there (yes, that is a rant against the .NET SDK!): Windows Azure SDK for PHP. We’ve been working very hard with an expanding globally distributed team on getting this version out.
-
Copy packages from one NuGet feed to another
Yesterday, a funny discussion was going on at the NuGet Discussion Forum on CodePlex. Funny, you say? Well yes. Funny because it was about a feature we envisioned as being a must-have feature for the NuGet ecosystem: copying packages from the NuGet feed to another feed. And funny because we already have that feature present in MyGet. You may wonder why anyone wants to do that? Allow me to explain.
-
Windows Azure Accelerator for Web Roles
One of the questions I often get around Windows Azure is: “Is Windows Azure interesting for me?”. It’s a tough one, because most of the time when someone asks that question they currently already have a server somewhere that hosts 100 websites. In the full-fledged Windows Azure model, that would mean 100 x 2 (we want the SLA) = 200 Windows Azure instances. And a stroke at the end of the month when the bill arrives. Microsoft’s DPE team have released something very interesting for those situations though: the Windows Azure Accelerator for Web Roles.
-
A hidden gem in the Windows Azure SDK for PHP: command line parsing
It’s always fun to dive into frameworks: often you’ll find little hidden gems that can be of great use in your own projects. A dive into the Windows Azure SDK for PHP learned me that there’s a nifty command line parsing tool in there which makes your life easier when writing command line scripts. Usually when creating a command line script you would parse $_SERVER['argv'], validate values and check whether required switches are available or not. With the Microsoft_Console_Command class from the Windows Azure SDK for PHP, you can ease up this task. Let’s compare writing a simple “hello” command.
-
A first look at Windows Azure AppFabric Applications
After the Windows Azure AppFabric team announced the availability of Windows Azure AppFabric Applications (preview), I signed up for early access immediately and got in. After installing the tools and creating a namespace through the portal, I decided to give it a try to see what it’s all about. Note that Neil Mackenzie also has an extensive post on “WAAFapps” which I recommend you to read as well. Before answering that question, let’s have a brief look at what Windows Azure is today. According to Microsoft, Windows Azure is a “PaaS” (Platform-as-a-Service) offering. What that means is that Windows Azure offers a series of platform components like compute, storage, caching, authentication, a service bus, a database, a CDN, … to your applications.
-
Officially a cloudhead now! (or: re-awarded MVP)
Woohoo! I just received the great mail I expect yearly on the first of July: Dear Maarten Balliauw, Congratulations! We are pleased to present you with the 2011 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Windows Azure technical communities during the past year. The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership." Toby Richards General Manager Community & Online Support
-
Delegate feed privileges to other users on MyGet
One of the first features we had envisioned for MyGet and which seemed increasingly popular was the ability to provide other users a means of managing packages on another user’s feed. As of today, we’re proud to announce the following new features: Now when is Microsoft going to buy us out :-) MyGet now allows you to make another MyGet user “co-admin” or “contributor” to a feed. This eases management of a private feed as that work can be spread across multiple people. If combined with the “private feeds” option, it’s also possible to give some users read access to the feed while unauthenticated users can not access the feed created.
-
Enabling conditional Basic HTTP authentication on a WCF OData service
Yes, a long title, but also something I was not able to find too easily using Google. Here’s the situation: for MyGet, we are implementing basic authentication to the OData feed serving available NuGet packages. If you recall my post Using dynamic WCF service routes, you may have deducted that MyGet uses that technique to have one WCF OData service serving the feeds of all our users. It’s just convenient! Unless you want basic HTTP authentication for some feeds and not for others… After doing some research, I thought the easiest way to resolve this was to use WCF intercepting. Convenient, but how would you go about this? And moreover: how to make it extensible so we can use this for other WCF OData (or WebAPi) services in the future?
-
Community Day 2011 - Fun with ASP.NET MVC, MEF and NuGet
To start the blog post: AWESOME! That’s what I have to say about the latest edition of Community Day 2011. I had the privilege of doing a session on ASP.NET MVC 3, MEF and NuGet, and as promised to the audience: here are the slides. For those who want to see the session, the recording can be found on Channel 9 from a previous event. “Fun with ASP.NET MVC3, MEF and NuGet” Community Day 2011, Mechelen, Belgium, 23/06/2011 Abstract: “So you have a team of developers… And a nice architecture to build on… How about making that architecture easy for everyone and getting developers up to speed quickly? Learn all about integrating the managed extensibility framework (MEF) and ASP.NET MVC with some NuGet sauce for creating loosely coupled, easy to use architectures that anyone can grasp.”
-
Advanced scenarios with Windows Azure Queues
For DeveloperFusion, I wrote an article on Windows Azure queues. Interested in working with queues and want to use some advanced techniques? Head over to the article: Last week, in Brian Prince’s article, Using the Queuing Service in Windows Azure, you saw how to create, add messages into, retrieve and consume those messages from Windows Azure Queues. While being a simple, easy-to-use mechanism, a lot of scenarios are possible using this near-FIFO queuing mechanism. In this article we are going to focus on three scenarios which show how queues can be an important and extremely scalable component in any application architecture: The techniques used in every scenario can be re-used in many applications and often be combined into an approach that is both scalable and reliable.
-
MyGet now supports pushing from the command line
One of the work items we had opened for MyGet was the ability to push packages to a private feed from the command line. Only a few hours after our initial launch, David Fowler provided us with example code on how to implement NuGet command line pushes on the server side. An evening of coding later, I quickly hacked this into MyGet, which means that we now support pushing packages from the command line!
-
Slides for NDC2011 - Oslo
It was great speaking at NDC2011! As promised during the sessions I gave, here are the slide decks: Going for noodles now. Cheers!
-
Creating your own private NuGet feed: MyGet
Ever since NuGet came out, I’ve been thinking about leveraging it in a corporate environment. I've seen two NuGet server implementations appear on the Internet: the official NuGet gallery server and Phil Haack’s NuGet.Server package. As these both are good, there’s one thing wrong with them: you can't be lazy! You have to do some stuff you don’t always want to do, namely: configure and deploy. After discussing some ideas with my colleague Xavier Decoster, we decided it’s time to turn our heads into the cloud: we’re providing you NuGet-as-a-Service (NaaS)! Say hello to MyGet.
-
Scaffolding and packaging a Windows Azure project in PHP
With the fresh release of the Windows Azure SDK for PHP v3.0, it’s time to have a look at the future. One of the features we’re playing with is creating a full-fledged replacement for the current Windows Azure Command-Line tools available. These tools sometimes are a life saver and sometimes a big PITA due to baked-in defaults and lack of customization options. And to overcome that last one, here’s what we’re thinking of: scaffolders. Basically what we’ll be doing is splitting the packaging process into two steps: To get a feeling about all this, I strongly suggest you to download the current preview version of this new concept and play along. By the way: feedback is very welcome! Just comment on this post and I’ll get in touch.
-
Just released: MvcSiteMapProvider 3.1.0 RC
It looks like I’m really cr… ehm… releasing way too much over the past few days, but yes, here’s another one: I just posted MvcSiteMapProvider 3.1.0 RC both on CodePlex and NuGet. The easiest way to get the current bits is this one: As usual, here are the release notes:
-
Windows Azure SDK for PHP v3.0 released
Microsoft and RealDolmen are very proud to announce the availability of the Windows Azure SDK for PHP v3.0 on CodePlex! (here's the official Microsoft post) This open source SDK gives PHP developers a speed dial library to fully take advantage of Windows Azure’s cool features. Version 3.0 of this SDK marks an important milestone because we’re not only starting to witness real world deployment, but also we’re seeing more people joining the project and contributing.
-
Microsoft .NET Framework 4 Platform Update 1 KB2478063 Service Pack 5 Feature Set 3.1 R2 November Edition RTW
As you can see, a new .NET Framework version just came out. Read about it at http://blogs.msdn.com/b/endpoint/archive/2011/04/18/microsoft-net-framework-4-platform-update-1.aspx. Now why does my title not match with the title from the blog post I referenced? Well… How is this going to help people? For those who don’t see the problem, let me explain… If we get new people on board that are not yet proficient enough in .NET, they all struggle with some concepts. Concepts like: service packs for a development framework. Or better: client profile stuff! Stuff that breaks their code because stuff is missing in there! I feel like this is going the Java road where every version has a billion updates associated with it. That’s not where we want to go, right? The Java side?
-
A Glimpse at Windows Identity Foundation claims
For a current project, I’m using Glimpse to inspect what’s going on behind the ASP.NET covers. I really hope that you have heard about the greatest ASP.NET module of 2011: Glimpse. If not, shame on you! Install-Package Glimpse immediately! And if you don’t know what I mean by that, NuGet it now! (the greatest .NET addition since sliced bread). This project is also using Windows Identity Foundation. It’s really a PITA to get a look at the claims being passed around. Usually, I do this by putting a breakpoint somewhere and inspecting the current IPrincipal’s internals. But with Glimpse, using a small plugin to just show me the claims and their values is a no-brainer. Check the right bottom of this '(partial) screenshot:
-
Using dynamic WCF service routes
For a demo I am working on, I’m creating an OData feed. This OData feed is in essence a WCF service which is activated using System.ServiceModel.Activation.ServiceRoute. The idea of using that technique is simple: map an incoming URL route, e.g. “http://example.com/MyService” to a WCF service. But there’s a catch in ServiceRoute: unlike ASP.NET routing, it does not support the usage of route data. This means that if I want to create a service which can exist multiple times but in different contexts, like, for example, a “private” instance of that service for a customer, the ServiceRoute will not be enough. No support for having http://example.com/MyService/Contoso/ and http://example.com/MyService/AdventureWorks to map to the same “MyService”. Unless you create multiple ServiceRoutes which require recompilation. Or… unless you sprinkle some route magic on top!
-
Wordpress auto sign-on with IIS7 and a plugin
For our RealDolmen blog platform, where we use Wordpress as the engine running multiple external and internal blogs (yes, that’s an internal SaaS we have there!), we wanted to have an easy solution for our employees to sign-on to the platform. We had a look at the Wordpress plugin repository and found the excellent Simple LDAP Login plugin for providing sign-on through Active Directory. This allowed for sign-on using Active Directory credentials. However, when browsing the blogs from the corporate network, the login page is one extra step in the way of users: they are already logged on to the network, so why sign-on again using the same credentials?
-
Geographically distributing Windows Azure applications using Traffic Manager
With the downtime of Amazon EC2 this week, it seems a lot of websites “in the cloud” are down at the moment. Most comments I read on Twitter (and that I also made, jokingly :-)) are in the lines of “outrageous!” and “don’t go cloud!”. While I understand these comments, I think they are wrong. These “clouds” can fail. They are even designed to fail, and often provide components and services that allow you to cope with these failures. You just have to expect failure at some point in time and build it into your application.
-
Windows Azure SDK for PHP v3.0.0 BETA released
Microsoft and RealDolmen are very proud to announce the availability of the Windows Azure SDK for PHP v3.0.0 BETA on CodePlex. This releases is something we’ve been working on in the past few weeks, implementing a lot of new features that enable you to fully leverage the Windows Azure platform from PHP. This release is BETA software, which means it is feature complete. However, since we have one breaking change, we’re releasing a BETA first to ensure every edge case is covered. Of you are using the current version of the Windows Azure SDK for PHP, feel free to upgrade and let us know your comments.
-
Slides for my talk at MIX11: Fun with ASP.NET MVC 3, MEF and NuGet
As promised, here are the slides and demo code for my talk "Fun with ASP.NET MVC 3, MEF and NuGet" I presented at MIX in Las Vegas. Abstract: "So you have a team of developers… And a nice architecture to build on… How about making that architecture easy for everyone and getting developers up to speed quickly? Learn all about integrating the managed extensibility framework (MEF) and ASP.NET MVC with some NuGet sauce for creating loosely coupled, easy to use architectures that anyone can grasp." The recorded session: (on Channel 9) The slide deck: The demo code: 2011-04-14 Fun with ASP.NET MVC 3 MEF.zip (6.76 mb) Enjoy! And thanks for joining!
-
Official Belgium TechDays 2011 Windows Phone 7 app released
I’m proud to announce that we (RealDolmen) have released the official Belgium TechDays 2011 Windows Phone 7 app! The official Belgium TechDays 2011 gives you the ability to browse current & upcoming sessions, as well as provide LIVE feedback to the event organizers. Is the current session awesome? Let us know! Is the food too spicy? Let us know!
-
Lightweight PHP application deployment to Windows Azure
Those of you who are deploying PHP applications to Windows Azure, are probably using the Windows Azure tooling for Eclipse or the fantastic command-line tools available. I will give you a third option that allows for a 100% customized setup and is much more lightweight than the above options. Of course, if you want to have the out-of-the box functionality of those tools, stick with them. Note: while this post is targeted at PHP developers, it also shows you how to build your own .cspkg from scratch for any other language out there. That includes you, .NET and Ruby! Oh, my syntax highlighter is broken so you won't see any fancy colours down this post :-)
-
Windows Azure and scaling: how? (PHP)
One of the key ideas behind cloud computing is the concept of scaling.Talking to customers and cloud enthusiasts, many people seem to be unaware about the fact that there is great opportunity in scaling, even for small applications. In this blog post series, I will talk about the following: In order to keep things DRY (Don’t Repeat Yourself), I’ll just link you to the previous post (Windows Azure and scaling: how? (.NET)) for this one. For PHP however, you’ll be needing a .pem certificate. Again, for the lazy, here’s mine (management.pfx (4.05 kb), management.cer (1.18 kb) and management.pem (5.11 kb)). If you want to create one yourself, check this site where you can convert and generate certificates.
-
Windows Azure and scaling: how? (.NET)
One of the key ideas behind cloud computing is the concept of scaling.Talking to customers and cloud enthusiasts, many people seem to be unaware about the fact that there is great opportunity in scaling, even for small applications. In this blog post series, I will talk about the following: In order to be able to programmatically (and thus possibly automated) scale your Windows Azure service, one prerequisite exists: a management certificate should be created and uploaded to Windows Azure through the management portal at http://windows.azure.com. Creating a certificate is easy: follow the instructions listed on MSDN. It’s as easy as opening a Visual Studio command prompt and issuing the following command:
-
Windows Azure CDN updates
The Windows Azure team has just put out the new Windows Azure SDK 1.4 for download. Next to that, I noticed some interesting new capabilities for the CDN (Content Delivery Network): That first one looks very interesting: before today, if you wanted to use the CDN feature, you’d have to upload all static content that should be served by the CDN to your bob storage account. Today, you can just use any hosted service as your CDN “source data” provider. This means you can deploy your application on Windows Azure and have its static content (or cachable dynamic content) cached in the CDN and delivered from edge locations all over the world.
-
Put your cloud on a diet (or: Windows Azure and scaling: why?)
One of the key ideas behind cloud computing is the concept of scaling.Talking to customers and cloud enthusiasts, many people seem to be unaware about the fact that there is great opportunity in scaling, even for small applications. In this blog post series, I will talk about the following: Both for small and large project, scaling your application’s capacity to meet the actual demand can be valuable. Imagine a local web application that is being used mostly during office hours, with peak demand from 6 PM to 8 PM. It consists of 4 web role instances running all day, which is enough to cope with peaks. Also, the number can be increased over time to meet actual demand of the web application.
-
Authenticate Orchard users with AppFabric Access Control Service
From the initial release of Orchard, the new .NET CMS, I have been wondering how difficult (or easy) it would be to integrate external (“federated”) authentication like Windows Azure AppFabric Access Control Service with it. After a few attempts, I managed to wrap-up a module for Orchard which does that: Authentication.Federated. After installing, configuring and enabling this module, Orchard’s logon page is replaced with any SAML 2.0 STS that you configure. To give you a quick idea of what this looks like, here are a few screenshots: As you can see from the sequence above, Authentication.Federated does the following: Just as a reference, I’ll show you how to configure the module.
-
Thank you for getting me in Vegas!
I wish to thank everyone who has been voring for getting me in Vegas, speaking at MIX11. Without having expectations, I was really really surprised (and happy!) my session got selected. Thanks a bunch! Oh and thanks, RealDolmen, for supporting me in doing things like this!
-
MvcSiteMapProvider 3.0.0 released
Just a quick note to tell that MvcSiteMapProvider 3.0.0 has been released and is available on CodePlex and NuGet. This version is targeted at ASP.NET MVC 3. If you are still using ASP.NET MVC 2, no worries: version 2.3.1 contains the exact same functionality but is targeted at ASP.NET MVC 2. The changelog: Enjoy!
-
ASP.NET MVC and the Managed Extensibility Framewok on NuGet
If you search on my blog, there’s a bunch of posts where I talk about ASP.NET MVC and MEF. And what’s cool: these posts are the ones that are actually being read quite often. I’m not sure about which bloggers actually update their posts like if it was software, but I don’t. Old posts are outdated, that’s the convention when coming to my blog. However I recently received a on of questions if I could do something with ASP.NET MVC 3 and MEF. I did, and I took things seriously.
-
Introducing the PHP on Azure Contest
It’s not every day that I get to be in the jury for a contest. It’s not every day that I deliver a training about PHP on Azure. Since this is about a contest where I’m doing both, I thought this is definitely worth telling you: The PHP on Azure Contest is a coding competition run by the PHP Benelux User Group supported by Microsoft. Windows Azure is Microsoft’s Cloud platform with tools and support for PHP. Participate to win a ticket, airfare and hotel to visit MIX2012 in Las Vegas, a Windows Phone 7 or other great prizes!
-
Viva, Las Vegas!
I have asked it last year, and I’ll ask it again. One of my session proposals made it to the “short”list for MIX11. One thing left though: votes are the only currency to get my session proposal in Vegas. Here’s the session abstract: So you have a team of developers? And a nice architecture to build on? How about making that architecture easy for everyone and getting developers up to speed quickly? Learn all about integrating the managed extensibility framework and ASP.NET MVC for creating loosely coupled, easy to use architectures that anyone can grasp. If you think this session deserves a place in Vegas, please cast your vote right here. And while you are at it, feel free to vote for both of my direct colleagues Kevin Dockx and Sandrino Di Mattia as well.
-
Writing an Orchard widget: LatestTwitter
Last week, Microsoft released Orchard, a new modular CMS system built on ASP.NET MVC and a lot of other, open source libraries available. I will not dive into the CMS itself, but after fiddling around with it I found a lot of things missing: there are only 40 modules and widgets available at the moment and the only way to have a more rich ecosystem of modules is: contributing! And that’s what I did. Feel the need to add a list of recent tweets by a certain user to your Orchard website? Try my LatestTwitter widget. Here’s a screenshot of the widget in action: And here’s what the admin side looks like: It supports: In this blog post, I’ll give you some pointers on how to create your own widget for Orchard. Download the code if you want to follow step by step: LatestTwitter.zip (1.56 mb)
-
ASP.NET MVC and jQuery Mobile
With the release of Windows Phone 7 last year, I’m really interested in mobile applications. Why? Well, developing for Windows Phone 7 did not require me to learn new things. I can use my current skill set and build cool apps for that platform. But what about the other platforms? If you look at all platforms from a web developer perspective, there’s one library that also allows you to use your existing skill set: jQuery Mobile. Know HTML? Know jQuery? Know *any* web development language like PHP, RoR or ASP.NET (MVC)? Go ahead and build great looking mobile web apps! I’ll give you a very short tutorial, just enough to sparkle some interest. After that, it’s up to you.
-
Tools for the lazy: Templify and NuGet
In this blog post, I will cover two interesting tools that, when combined, can bring great value and speed at the beginning of any new software project that has to meet standards that are to be re-used for every project. The tools? Templify and NuGet. You know the drill. Starting off with a new project usually consists of boring, repetitive tasks, often enforced by (good!) practices defined by the company you work for (or by yourself for that company). To give you an example of a project I’ve recently done: Maybe you are planning to use jQuery UI? Oh right and what was that class you needed to work with MEF inside ASP.NET MVC? Let’s add that one as well:
-
Byebye 2010, welcome 2011!
Happy New Year 2011! I wish you all the best in your career and personal life. And I know it’s a classic one: I wish you a good health! Some family members have had some serious issues on that part and really, health is the most imprtant thing you need. All the rest depends on that. If you’re healthy, you will do something, that something will earn you money, and money buys you things. An Indian taxi driver in Redmond, Seattle, WA told me this exact lesson this year. I was a bit fuzzy at that time after a long flight from Belgium, Europe, but he is right. Sandeep, happy new year to you to although you may probably not read my blog. In this kind of posts, just like in 2008 and 2009, I’ll start with looking at the top blog posts.
-
The quickest way to a VPN: Windows Azure Connect
First of all: Merry Christmas in advance! But to be honest, I already have my Christmas present… I’ll give you a little story first as it’s winter, dark outside and stories are better when it’s winter and you are reading this post n front of your fireplace. Last week, I received the beta invite for Windows Azure Connect, a simple and easy-to-manage mechanism to setup IP-based network connectivity between on-premises and Windows Azure resources. Being targeted at interconnecting Windows Azure instances to your local network, it also contains a feature that allows interconnecting endpoints. Interesting!
-
Windows Azure Remote Desktop Access
The latest relase of the WIndows Azure platform, portal and tools (check here) includes support for one of the features announced at PDC last month: remote desktop access to your role instances. This feature is pretty easy to use and currently allows you to deploy a preconfigured VM with IIS where you can play with the OS. No real application needed! Here’s how:
-
Writing for the Windows Azure for PHP portal
I actually just noticed it has been a while since I did a blog post. I also know that writing about this is not really a good idea in the blogosphere. Unless… it’s for a good reason! The good reason for not being that active on my blog lately is the fact that I’m producing content for Microsoft’s Interoperability team. Have you ever wanted to start working with Windows Azure and PHP? No idea where to start? Meet the official portal: Developing Applications for Azure with PHP. I’ve currently posted some tutorials and scenarios out there, but there’s more to come. Here’s a list of what’s currently available:
-
MvcSiteMapProvider 2.2.0 released
I’m proud to announce that MvcSiteMapProvider 2.2.0 has just been uploaded to CodePlex. It should also be available through NuPack in the coming hours. This release has taken a while, but that’s because I’ve been making some important changes... MvcSiteMapProvider is, as the name implies, an ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework. Targeted at ASP.NET MVC 2, it provides sitemap XML functionality and interoperability with the classic ASP.NET sitemap controls, like the SiteMapPath control for rendering breadcrumbs and the Menu control. In this post, I’ll give you a short update on what has changed as well as some examples on how to use newly introduced functionality.
-
Scale-out to the cloud, scale back to your rack
That is a bad blog post title, really! If Steve and Ryan have this post in the Cloud Cover show news I bet they will make fun of the title. Anyway… Imagine you have an application running in your own datacenter. Everything works smoothly, except for some capacity spikes now and then. Someone has asked you for doing something about it with low budget. Not enough budget for new hardware, and frankly new hardware would be ridiculous to just ensure capacity for a few hours each month. A possible solution would be: migrating the application to the cloud during capacity spikes. Not all the time though: the hardware is in house and you may be a server-hugger that wants to see blinking LAN and HDD lights most of the time. I have to admit: blinking lights are cool! But I digress.
-
Windows Phone 7 First Impressions
Back in june of this year, I received a very surprising e-mail stating that I would receive a Windows Phone 7 developer device. The reason for this? No, not that I’m handsome. But the fact that I paid $99 for listing an application in the marketplace that they were hoping me to port to Windows Phone 7. The wait continued: july? No phone. August? No phone. By september I thought I was not getting a Windows Phone 7 anymore. Until this week: another e-mail stating that the device was shipped. And today, FedEx kindly handed me over a developer device. After installing my SIM card and starting the phone, I was welcomed by the nice looking Windows Phone 7 tiles. And that is where the rest of my journey started…
-
Using MvcSiteMapProvider throuh NuPack
Probably you have seen the buzz around NuPack, a package manager for .NET with thight integration in Visual Studio 2010. NuPack is a free, open source developer focused package management system for the .NET platform intent on simplifying the process of incorporating third party libraries into a .NET application during development. If you download and install NuPack into Visual Studio, you can now reference MvcSiteMapProvider with a few simple clicks! From within your ASP.NET MVC 2 project, right click the project file and use the new “Add Package Reference…” option.
-
Cost Architecting for Windows Azure
Just wanted to do a quick plug to an article I’ve written for TechNet Magazine: Windows Azure: Cost Architecting for Windows Azure. Designing applications and solutions for cloud computing and Windows Azure requires a completely different way of considering the operating costs. Cloud computing and platforms like Windows Azure are billed as “the next big thing” in IT. This certainly seems true when you consider the myriad advantages to cloud computing. Computing and storage become an on-demand story that you can use at any time, paying only for what you effectively use. However, this also poses a problem. If a cloud application is designed like a regular application, chances are that that application’s cost perspective will not be as expected.
-
PHP on Windows and on Azure slide deck
As promised during my session on PHP Summer Camp in Lisbon, Portugal, here's the slide deck. Thanks for joining!
-
Remix 2010 slides and sample code
As promised during my session on Remix 10 yesterday in Belgium, here's the slide deck and sample code. Abstract: “It’s time to take advantage of the cloud! In this session Maarten builds further on the application created during Gill Cleeren’s Silverlight session. The campaign website that was developed in Silverlight 4 still needs a home. Because the campaign will only run for a short period of time, the company chose for cloud computing on the Windows Azure platform. Learn how to leverage flexible hosting with automated scaling on Windows Azure, combined with the power of a cloud hosted SQL Azure database to create a cost-effective and responsive web application.” Thanks for joining and bearing with me during this tough session with very sparse bandwidth!
-
Windows Azure Diagnostics in PHP
When working with PHP on Windows Azure, chances are you may want to have a look at what’s going on: log files, crash dumps, performance counters, … All this is valuable information when investigating application issues or doing performance tuning. Windows Azure is slightly different in diagnostics from a regular web application. Usually, you log into a machine via remote desktop or SSH and inspect the log files: management tools (remote desktop or SSH) and data (log files) are all on the same machine. This approach also works with 2 machines, maybe even with 3. However on Windows Azure, you may scale beyond that and have a hard time looking into what is happening in your application if you would have to use the above approach. A solution for this? Meet the Diagnostics Monitor.
-
Introducing Windows Azure Companion – Cloud for the masses?
At OSIDays in India, the Interoperability team at Microsoft has made an interesting series of announcements related to PHP and Windows Azure. To summarize: Windows Azure Tools for Eclipse for PHP has been updated and is on par with Visual Studio tooling (which means you can deploy a PHP app to Windows Azure without leaving Eclipse!). The Windows Azure Command-line Tools for PHP have been updated, and there’s a new release of the Windows Azure SDK for PHP and a Windows Azure Storage plugin for WordPress built on that.
-
Announcing the Windows Azure Online Conference
Steve Plank from Microsoft UK has just announced the UK Windows Azure Online Conference on his blog. This will be a whole day, online Windows Azure conference consisting of three different tracks: Cirrus – the high level stuff, Altocumulus – the mid level stuff (cast studies) and Stratocumulus – the low level stuff (deep tech). I’ll be doing a session in the Stratocumulus track. Since this is an online conference, feel free to subscribe for the event! All details can be found on the UK Windows Azure Online Conference announcement. I feel this is going to be very interesting, covering a broad range of Windows Azure topics! Here’s the list of sessions I’ll try to attend: The only thing I’m wondering about: how are they going to provide lunch through Live Meeting…
-
BlogEngine.NET comment spam filtering
It’s been a month or three since I was utterly fed up with comment spam on my blog. Sure, I did turn on comment moderation so you, as a visitor, would not notice this spam if I did not approve it as a valid comment. However, I found myself cleaning up comment spam from in between legitimate comments in the BlogEngine.NET admin interface. In an effort of trying to reduce comment spam, I tried the following: Luckily, the latest version of BlogEngine.NET (and also earlier version if you go down the hacky road) featured a new comment system, including spam filtering. After using it for a few months, I must say I’m very close to zero comment spam! I have configured BlogEngine.NET as follows:
-
Book review: Refactoring with Visual Studio 2010
Yet again, Packt Publishing has sent me a book for review. For once, one without the typical orange/black cover but instead a classy white/black cover: Refactoring with Visual Studio 2010 by Peter Ritchie. Since my book shelf is quite heavy on the Packt side (really, almost have their complete collection I guess, they keep sending me books), I was a bit in doubt if I should write yet another review for one of their books as I think I’m starting to sound like a Packt marketing guy. After reading it though, I thought that this book deserves some credit!
-
Hybrid Azure applications using OData
In the whole Windows Azure story, Microsoft has always been telling you could build hybrid applications: an on-premise application with a service on Azure or a database on SQL Azure. But how to do it in the opposite direction? Easy answer there: use the (careful, long product name coming!) Windows Azure platform AppFabric Service Bus to expose an on-premise WCF service securely to an application hosted on Windows Azure. Now how would you go about exposing your database to Windows Azure? Open a hole in the firewall? Use something like PortBridge to redirect TCP traffic over the service bus? Why not just create an OData service for our database and expose that over AppFabric Service Bus. In this post, I’ll show you how.
-
Simplified access control using Windows Azure AppFabric Labs
Earlier this week, Zane Adam announced the availability of the New AppFabric Access Control service in LABS. The highlights for this release (and I quote): Wow! This just *has* to be good! Let’s see how easy it is to work with claims based authentication and the AppFabric Labs Access Control Service, which I’ll abbreviate to “ACS” throughout this post. In essence, I’ll be “outsourcing” the access control part of my application to the ACS. When a user comes to the application, he will be asked to present certain “claims”, for example a claim that tells what the user’s role is. Of course, the application will only trust claims that have been signed by a trusted party, which in this case will be the ACS.
-
MvcSiteMapProvider 2.1.0 released!
The release for MvcSiteMapProvider 2.1.0 has just been posted on CodePlex. MvcSiteMapProvider is, as the name implies, an ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework. Targeted at ASP.NET MVC 2, it provides sitemap XML functionality and interoperability with the classic ASP.NET sitemap controls, like the SiteMapPath control for rendering breadcrumbs and the Menu control. Next to a brand new logo, the component has been patched up with several bugfixes, the visibility attribute is back (in a slightly cooler reincarnation) and a number of new extension points have been introduced. Let’s give you a quick overview…
-
ASP.NET MVC 3 and MEF sitting in a tree...
As I stated in a previous blog post: ASP.NET MVC 3 preview 1 has been released! I talked about some of the new features and promised to do a blog post in the dependency injection part. In this post, I'll show you how to use that together with MEF. Download my sample code: Mvc3WithMEF.zip (256.21 kb) First of all, there’s 4 new hooks for injecting dependencies:
-
ASP.NET MVC 3 preview 1 is out! Quick review...
I just noticed a very interesting download: ASP.NET MVC 3 preview 1. Yes, you are reading this correctly, the first bits for v3.0 are there! Let’s have a quick look around and see what’s new... ScottGu blogged about Razor before. ASP.NET MVC has always supported the concept of “view engines”, pluggable modules that allow you to have your views rendered by different engines like for example the WebForms engine, Spark, NHAML, … Razor is a new view engine, focused on less code clutter and shorter code-expressions for generating HTML dynamically. As an example, have a look at the following view: [code:c#] <ul> <% foreach (var c in Model.Customers) { %> <li><%:c.DisplayName%></li> <% } %> </ul> [/code] In Razor syntax, this becomes: [code:c#]
-
Manage your SQL Azure database from your browser
Yesterday, I noticed on Twitter that the SQL Azure - Project “Houston” CTP 1 has been released online. For those who do not know Houston, this is a lightweight and easy to use database management tool for SQL Azure databases built in Silverlight. Translation: you can now easily manage your SQL Azure database using any browser. It’s not a replacement for SSMS, but it’s a viable, quick solution into connecting to your cloudy database. After connecting to your SQL Azure database through http://manage.sqlazurelabs.com, you’ll see a quick overview of your database elements (tables, views, stored procedures) as well as a fancy, three-dimensional cube displaying your database details. Let’s create a new table… After clicking the “New table” toolbar item on top, a simple table designer pops up:
-
Renewed MVP ASP.NET for 2010!
Just got the best e-mail a Microsoft community member can receive in his mailbox: Dear Maarten Balliauw, Congratulations! We are pleased to present you with the 2010 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in ASP/ASP.NET technical communities during the past year. (...) Toby Richards General Manager Community Support Services I wish to thank everyone who has been supporting me, encouraging me, challenging me and thus bringing me to a second year of MVP duty. I will try to achieve the same for next year: do a lot of sessions, work on open-source, do blog posts, …
-
ASP.NET MVC - MvcSiteMapProvider 2.0 is out!
I’m very proud to announce the release of the ASP.NET MVC MvcSiteMapProvider 2.0! I’m also proud that the name of this product now exceeds the average length of Microsoft product names. In this blog post, I will give you a feel of what you can (and can not) do with this ASP.NET-specific SiteMapProvider. As a warning: if you’ve used version 1 of this library, you will notice that I have not thought of backwards compatibility. A lot of principles have also changed. For good reasons though: this release is a rewrite of the original version with improved features, extensibility and stability. The example code is all based on the excellent ASP.NET MVC Music Store sample application by Jon Galloway.
-
Running on Windows Azure - ChronoRace - Autoscaling
At RealDolmen, we had the luck of doing the first (known) project on Windows Azure in Belgium. Together with Microsoft, we had the opportunity to make the ChronoRace website robust enough to withstand large sports events like the 20km through Brussels.
-
Extension methods for PHP
The concept of “extension” methods will be nothing new to this blog’s .NET-related audience. For the PHP-related audience, this is probably something new. Let’s start with the official definition for extension methods: Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. Let’s visualize this. Imagine having the following class: [code:c#]
-
Book review: PHP 5 E-commerce Development
Once again, Packt Publishing has asked me to do a book review on one of their latest books, "PHP 5 E-commerce Development” by Michael Peacock. The book promises the following: All of this is true, but… Not all is negative of course! The writing style is good and provides an easy read. Next to that, all concepts and pitfalls that go with building an online commerce site are well explained. Still, my advise on this book would not be “buy it”.
-
Taking Care of a Cloud Environment (slides)
It looks like I’m only doing sessions lately :-) Here’s another slide deck for a presentation I did on the Architect Forum last week in Belgium. Abstract: “No, this session is not about greener IT. Learn about using the RoleEnvironment and diagnostics provided by Windows Azure. Communication between roles, logging and automatic upscaling of your application are just some of the possibilities of what you can do if you know about how the Windows Azure environment works.” Thanks for attending!
-
Linuxwochen Austria
As part of my global domination plans, I this week visited Vienna, Austria for a session at Linuxwochen around PHP on Windows. Abstract: “Ever wanted to get started with PHP development on Windows? This session covers the basics of running PHP on the Windows platform and will help getting your development environment ready.” Thanks for being in this session! I know it is a controversial one on a Linux event :-)
-
Slides of our VISUG session
As promised, here are the slides of the VISUG session me and Kris van der Mast did yesterday. Abstract: “Don't tell us you're jealous of those Silverlight fanboys! We'll show you that applications with bling can be developed using ASP.NET MVC and jQuery. We're talking MVC, template helpers, AJAX, JSON, transitions, live bindings, ...”
-
TechDays 2010 Portugal slides and demo code
First of all: thank you for attending the sessions Kevin Dockx and I gave at TechDays 2010 Portugal! A wonder we made it there with all the ash clouds and volcanic interference based in Iceland. Abstract: “While working together with Microsoft on the Windows Azure SDK for PHP, we found that we needed an popular example application hosted on Microsoft’s Windows Azure. Wordpress was an obvious choice, but not an obvious task. Learn more about Windows Azure, the PHP SDK that we developed, SQL Azure and about the problems we faced porting an existing PHP application to Windows Azure.” I can not disclose demo code at this time, sorry. Here’s a list of good resources to get you started though:
-
Using Windows Azure Drive in PHP (or Ruby)
At the JumpIn Camp in Zürich this week, we are trying to get some of the more popular PHP applications running on Windows Azure. As you may know, Windows Azure has different storage options like blobs, tables, queues and drives. There’s the Windows Azure SDK for PHP for most of this, except for drives. Which is normal: drives are at the operating system level and have nothing to do with the REST calls that are used for the other storage types. By the way: I did a post on using Windows Azure Drive (or “XDrive”) a while ago if you want more info.
-
Running PHP on Windows Azure
Yesterday I did some talks on PHP and Windows Azure at JumpIn Camp in Zürich together with Josh Holmes. Here are the slide decks and samples we used. Josh talked on what Windows Azure is, what components are available and how you can get started with PHP and Windows Azure. I did not do the entire deck, but showed some slides and concepts. This is mainly the same content as Josh’s session with some additions. This deck talks about the different storage concepts and how to use them in PHP. As a demo, I had ImageCloud, a web application similar to Flickr. Here’s the sample code: ImageCloud.rar (5.00 mb)
-
Put your existing application in the cloud!
As promised during my talk, here's the slide deck for "Put your existing application in the cloud!". Abstract: "Leverage the highly scalable Windows Azure platform and deploy your existing ASP.NET application to a new home in the clouds. This demo filled session will guide you in how to make successful use of Windows Azure’s hosting and storage platform as well as SQL Azure, the relational database in the cloud, by moving an existing ASP.NET application to a higher level." And here's the live recording: Thanks for joining TechDays 2010 and my session!
-
Using FTP to access Windows Azure Blob Storage
A while ago, I did a blog post on creating an external facing Azure Worker Role endpoint, listening for incoming TCP connections. After doing that post, I had the idea of building a Windows Azure FTP server that served as a bridge to blob storage. Lack of time, other things to do, you name it: I did not work on that idea. Until now, that is.
-
MEF will not get easier, it’s cool as ICE
Over the past few weeks, several people asked me to show them how to use MEF (Managed Extensibility Framework), some of them seemed to have some difficulties with the concept of MEF. I tried explaining that it will not get easier than it is currently, hence the title of this blog post. MEF is based on 3 keywords: export, import, compose. Since these 3 words all start with a letter that can be combined to a word, and MEF is cool, here’s a hint on how to remember it: MEF is cool as ICE! Imagine the following: You want to construct a shed somewhere in your back yard. There’s tools to accomplish that, such as a hammer and a saw. There’s also material, such as nails and wooden boards. Let’s go for this! Here’s a piece of code to build the shed: [code:c#]
-
Introducing RealDolmenBlogs.com
Here’s something I would like to share with you. A few months ago, our company (RealDolmen) started a new website, RealDolmenBlogs.com. This site syndicates content from employee blogs, people with lots of experience in their range of topics. These guys have lots of knowledge to share, but sometimes their blog does not have a lot of attention from, well, you. Since we would really love to share employee knowledge, RealDolmenBlogs.com was born. The following topics are covered: Make sure to subscribe to the syndicated RSS feed and have quality content delivered to your RSS reader. Since I do not like to do blog posts on topic that do not have a technical touch, considered that the first few lines of text of this post are pure marketing in a sense, here’s the technical bit.
-
Running PHP in the Cloud slides and sample code
Just got back from London where I did a fun talk on PHP and Windows Azure yesterday evening. It was the first time I did a presentation after three beers, but I think it went allright. As promised, here's the slide deck and sample code (ImageCloud.rar (5.00 mb)). Abstract: "This session covers the basics of Microsoft’s Windows Azure cloud platform. Learn how you can develop and deploy a PHP application in Windows Azure, using the tools and libraries Microsoft provides. Creating a photo upload application, the different aspects of the Windows Azure platform are leveraged for creating a performant and scalable PHP application."
-
Sharpy - an ASP.NET MVC view engine based on Smarty
Are you also one of those ASP.NET MVC developers who prefer a different view engine than the default Webforms view engine available? You tried Spark, NHaml, …? If you are familiar with the PHP world as well, chances are you know Smarty, a great engine for creating views that can easily be read and understood by both developers and designers. And here’s the good news: Sharpy provides the same syntax for ASP.NET MVC! If you want more details on Sharpy, visit Jaco Pretorius’ blog: Here’s a simple example: [code:c#] {master file='~/Views/Shared/Master.sharpy' title='Hello World sample'} <h1>Blog entries</h1>
-
Jump in! camp - Call for participants
I just got the following invitation from Microsoft, and would like to encourage you to participate as well if you are interested in bot PHP and the Microsoft worlds. Jump In! and be a part of it! Open source programming and Microsoft: two incompatible worlds? Microsoft is partnering with renowned actors of the open-source community to organise the Jump In! Developers' Camp in an effort to combat this misperception. Twenty-five knowledge-hungry open source application developers from all over Europe will be invited to spend four unforgettable days of dialogue, networking and workshops at the beautiful Panorama Resort & Spa Feusisberg in Switzerland.
-
Using Windows Azure Drive (aka X-Drive)
With today’s release of the Windows Azure Tools and SDK version 1.1, also the Windows Azure Drive feature has been released. Announced at last year’s PDC as X-Drive, which has nothing to do with a well-known German car manufacturer, this new feature enables a Windows Azure application to use existing NTFS APIs to access a durable drive. This allows the Windows Azure application to mount a page blob as a drive letter, such as X:, and enables easily migration of existing NTFS applications to the cloud. This blog post will describe the necessary steps to create and/or mount a virtual hard disk on a Windows Azure role instance.
-
Just Another Wordpress Weblog, But More Cloudy
Slides of my talk at the PHPBenelux conference last weekend are online. Bit of a pity my live demo went wrong due to my www.azure.com trial account going into read-only mode while doing the demo. Abstract: "While working together with Microsoft on the Windows Azure SDK for PHP, we found that we needed an popular example application hosted on Microsoft’s Windows Azure. Wordpress was an obvious choice, but not an obvious task. Learn more about Windows Azure, the PHP SDK that we developed, SQL Azure and about the problems we faced porting an existing PHP application to Windows Azure." Thanks for joining the conference and my session! And thanks to the PHPBenelux crew for organizing their first conference ever, it rocked!
-
Translating routes (ASP.NET MVC and Webforms)
For one of the first blog posts of the new year, I thought about doing something cool. And being someone working with ASP.NET MVC, I thought about a cool thing related to that: let’s do something with routes! Since System.Web.Routing is not limited to ASP.NET MVC, this post will also play nice with ASP.NET Webforms. But what’s the cool thing? How about… translating route values?
-
PHPMEF 0.1.0 released!
A while ago, I did a conceptual blog post on PHP Managed Extensibility Framework – PHPMEF. Today, I’m proud to announce the first public release of PHPMEF! After PHPExcel, PHPLinq, PHPPowerPoint and the Windows Azure SDK for PHP, PHPMEF is the 5th open-source project I started on interoperability (or conceptual interoperability) between the Microsoft world and the PHP world. Noble price for peace upcoming :-) PHPMEF is a PHP port of the .NET Managed Extensibility Framework, allowing easy composition and extensibility in an application using the Inversion of Control principle and 2 easy keywords: @export and @import.
-
Creating an external facing Azure Worker Role endpoint
When Windows Azure was first released, only Web Roles were able to have an externally facing endpoint. Since PDC 2009, Worker Roles can now also have an external facing endpoint, allowing for a custom application server to be hosted in a Worker Role. Another option would be to run your own WCF service and have it hosted in a Worker Role. Features like load balancing, multiple instances of the Worker are all available. Let’s see how you can create a simple TCP service that can display the current date and time. Here’s what I want to see when I connect to my Azure Worker Role using telnet (“telnet efwr.cloudapp.net 1234”): Let’s go ahead and build this thing. Example code can be downloaded here: EchoCloud.zip (9.92 kb)
-
Ordering fields in ASP.NET MVC 2 templated helpers
Ever worked with the templated helpers provided by ASP.NET MVC 2? Templated helpers provide a way to automatically build UI based on a data model that is marked with attributes defined in the System.ComponentModel.DataAnnotations namespace. For example, a property in the model can be decorated with the attribute [DisplayFormat(DataFormatString = "{0:c}")], and the templated helpers will always render this field formatted as currency. If you have worked with templated helpers, you must agree: they can be useful! There’s one thing which is impossible in the current version: ordering fields. Take the following class and the rendered form using templated helpers: [code:c#]
-
Vote to help me speak at the MIX 2010 conference!
Everybody knows the Microsoft MIX event, right? The one in Las Vegas? The one with all the fancy web-related stuff? Rings a bell? Ok, great. In the beginning of December 2009, Microsoft did an open call for speakers, which I answered with some session proposals. Who doesn’t want to go to Vegas, right? The open call proposals have been processed (150+ sessions submitted, wow!) and a voting has started. Yes, you hear me coming: please go ahead and vote for a session I submitted. Voting ends January 15th, 2010. Since I could not decide which color of the voting banner matched best with my blog’s theme, I decided to put them all three online: Thanks in advance! PS: There's also Elijah Manor, Justin Etheredge, K. Scott Allen, and many others who submitted good looking sessions.
-
Byebye 2009, welcome 2010!
A year just ended, a new has begun. Congratulations! Happy newyear 2010! And welcome in the next decennium. It’s time for a 2009 wrap-up post. And perhaps, even the time for some things I want to do in 2010. First things first: the top 5 blog posts of 2009. 1. More ASP.NET MVC Best Practices – A blog post gathering best practices from different sources and adds some more of my own. 2. Code based ASP.NET MVC GridView (2008: 4th) – This post gives a shot at a gridview for the ASP.NET MVC framework, built using expressions. 3. Code performance analysis in Visual Studio 2008 (2008: 2nd) – Visual Studio developer, did you know you have a great performance analysis (profiling) tool at your fingertips?
-
Hoping they will learn… Usability!
How about ending the year 2009 with a blog post on something annoying I see on the Internet, as well as some others? I’m talking about automatic localization… Please, go ahead and read some tweets by @KvdM and @patrickv. And then, there’s my own annoyance on Windows Mobile Marketplace. The base for al this frustrated year-end whining has to do with the fact that there are assumptions being made about the location of a user, rather than about a user itself…
-
Cloud computing and the Windows Azure Services Platform (KU Leuven)
It was a fun session yesterday at KU Leuven university! I did a session on cloud computing and Windows Azure there for the IEEE Student Branch Leuven. Abstract: "This session covers the basics of the Windows Azure Services Platform and drills into some architectural challenges. Learn what components the Windows Azure Services Platform is built of and how they can be leveraged in building a scalable and reliable application." If you want more info about Windows Azure and how to develop, architect or benefit from the platform as a whole, register freely at the Azure User Group Belgium. Thank you for attending!
-
Microsoft Web Development Summit 2009
Being in the US for 2 times in a month (PDC09 and Web Development Summit) is fun, tiring and rewarding. The WDS09 was an invite-only event organized by Microsoft, focusing on interaction between Microsoft and the PHP community. I must say: the event has been helpful and interesting for both parties! This was actually my first time at the WDS which has been around for 5 years already. The Interop team invited me there, and I want to thank them for doing that: it was a great trip, a great event and I got the chance to meet lots of new people.
-
PHP Managed Extensibility Framework – PHPMEF
While flying sitting in the airplane to the Microsoft Web Developer Summit in Seattle, I was watching some PDC09 sessions on my laptop. During the MEF session, an idea popped up: there is no MEF for PHP! 3500 kilometers after that moment, PHP got its own MEF… MEF is a .NET library, targeting extensibility of projects. It allows you to declaratively extend your application instead of requiring you to do a lot of plumbing. All this is done with three concepts in mind: export, import and compose. (Glenn, I stole the previous sentence from your blog). “PHPMEF” uses the same concepts in order to provide this extensibility features.
-
Supporting multiple submit buttons on an ASP.NET MVC view
A while ago, I was asked for advice on how to support multiple submit buttons in an ASP.NET MVC application, preferably without using any JavaScript. The idea was that a form could contain more than one submit button issuing a form post to a different controller action. The above situation can be solved in many ways, one a bit cleaner than the other. For example, one could post the form back to one action method and determine which method should be called from that action method. Good solution, however: not standardized within a project and just not that maintainable… A better solution in this case was to create an ActionNameSelectorAttribute.
-
Book review: Zend Framework 1.8 Web Application Development
My book shelf is starting to look a lot like the warehouse of Packt Publishing: I’ve received yet another book from them. Different from all previous reviews I did: this one is a PHP book, titled “Zend Framework 1.8 Web Application Development” by Keith Pope. A chapter overview: Let’s also state the obvious: Zend Framework evolves much faster than publishers. The framework is now at 1.9.6, while the book covers 1.8.0. Do not let this stop you from reading this book! Let me explain why… These 2 points actually summarize the whole book. Great read, great content and a must-read for everyone who is not completely sure about his application design skills. Congratulations, Keith!
-
MSDN - Converting an existing ASP.NET application to Windows Azure
Back from PDC 2009 with a lot of information on Windows Azure, I did an MSDN Live Meeting on ASP.NET and Windows Azure today. Here's the slide deck and demo code. Abstract: "Put your stuff in the cloud! Windows Azure allows you to take advantage of cloud computing infranstructure for hosting, computing, and storage of your applications. In this demo filled session we take an existing ASP.Net Application and move it to be hosted in Windows Azure, while taking advantage of Windows Azure storage." Example code can be downloaded here: MSDN - Converting an existing ASP.NET application to Windows Azure.zip (2.01 mb) If you want more info about Windows Azure and how to develop, architect or benefit from the platform as a whole, register freely at the Azure User Group Belgium.
-
Microsoft PDC09 day 2 keynote highlights
Day 2 keynote at Microsoft PDC 2009 was quite exciting. To sum things up: Silverlight 4 went beta, IE9 features were previewed, and we got an external hard disk, nicely fitted in a tablet-pc format case. How thoughtful! Here’s some of the novelties: Silverlight 4 Beta
-
Microsoft PDC09 keynote highlights
Finally found some time to write a short blog post on the announcements this morning at PDC 2009. Ray Ozzie started the keynote this morning, focusing on Microsoft’s “three-screen” vision for the future. There will be three screens connected to the cloud: TV, (handheld) devices and of course good old PC. This vision is driven by some key players: Windows 7, Internet Explorer, Silverlight and Windows Azure. Make sure to have a look at these four if you want to play in this future. Some announcements were made as well:
-
Localize ASP.NET MVC 2 DataAnnotations validation messages
Living in a country where there are there are three languages being used, almost every application you work on requires some form of localization. In an earlier blog post, I already mentioned ASP.NET MVC 2’s DataAnnotations support for doing model validation. Ever since, I was wondering if it would be possible to use resource files or something to do localization of error messages, since every example that could be found on the Internet looks something like this: [code:c#] [MetadataType(typeof(PersonBuddy))] public class Person { public string Name { get; set; } public string Email { get; set; } } public class PersonBuddy { [Required(ErrorMessage = "Name is required.")] public string Name { get; set; }
-
Windows Azure Tools for Eclipse for PHP developers
Pfew! Finally I can spread the word on this! While working on the Windows Azure SDK for PHP, I had the opportunity to test-drive the development builds of the WIndows Azure Tools for Eclipse. Today, the project has been released officially at www.windowsazure4e.org. Windows Azure Tools for Eclipse provides a series of wizards and utilities that allow developers to write, debug, and configure for and deploy PHP applications to Windows Azure. The plug-in also bundles the existing Windows Azure SDK for PHP, which was introduced a few months ago. This SDK provides a simple API for PHP developers who use the Windows Azure storage component, making it very easy to use the blob, queue and table data storage features. Just visit the project site at http://phpazure.codeplex.com/.
-
Upcoming sessions on Azure, PHP and ASP.NET
It’s going to be a filled end of 2009… There’s Microsoft PDC which I will be attending and will probably cause me some sleepless nights (both due to jetlag and due to all the new stuff that will be released). Next to that, I’ll also be doing some sessions in the next few weeks. Here’s a list… Date Event 28 october 2009 PHPBenelux Meeting: PHP and Microsoft technologies I’ll be doing two sessions here: · PHP and Silverlight, together with Kevin Dockx “This session covers the basics of Microsoft Silverlight and demonstrates how PHP developers can benefit from developing rich client-side components that run in the web browser using Silverlight and PHP.”
-
Recording of my session at Remix 2009 - ASP.NET MVC
On September 29, I did a session on ASP.NET MVC at Remix 2009 Belgium. All session recordings are now online, check the Remix09 site. Slides and code for my talk can be found in a previous blog post. The video material can be found below. Enjoy! And feel free to leave some comments! Abstract: "Building a Twitter clone in 60 minutes, featuring what's new in ASP.NET MVC 2 preview 1 and focusing on some of the core ASP.NET MVC features like security and routing."
-
Let me Bing that for you
Have you ever been bugged with stupid questions? Do you get tired of people asking stuff that is only one search engine query away? Chances are you answered both of these questions with “yes!”. Together with Phil Haack and Juliën Hanssens, I created LetMeBingThatForYou.com, a website that generates a search engine query for people who ask you questions they could easily answer by themselves. One last note: this project is not associated with Microsoft nor Bing. We’re doing this project for fun.
-
Leveraging ASP.NET MVC 2 futures “ViewState”
Let’s start this blog post with a confession: yes, I abused a feature in the ASP.NET MVC 2 futures assembly to fire up discussion. In my previous blog post, I called something “ViewState in MVC” while it is not really ViewState. To be honest, I did this on purpose, wanting to see people discuss this possibly new feature in MVC 2. Discussion started quite fast: most people do not like the word ViewState, especially when it is linked to ASP.NET MVC. As Phil Haack pointed out in a comment on my previous blog post, I used this foul word where it was not appropriate. (…) I think calling it ViewState is very misleading. (…) what your serializing is the state of the Model, not the View. (…)
-
Exploring the ASP.NET MVC 2 futures assemby
The latest preview of ASP.NET MVC 2, preview 2, has been released on CodePlex last week. All features of the preview 1 version are still in, as well as some nice novelties like client-side validation, single project areas, the model metadata model, … You can read more about these here, here and here.
-
Remix 2009 session - Slides and code
As promised during the session at Remix 2009, here’s my example code and slide deck. Abstract: "Building a Twitter clone in 60 minutes, featuring what's new in ASP.NET MVC 2 preview 1 and focusing on some of the core ASP.NET MVC features like security and routing." Example code can be downloaded here: ASP.NET MVC Wisdom - ReMix.zip (8.91 mb) Thank you for attending!
-
Simple API for Cloud Application Services
Zend, in co-operation with IBM, Microsoft, Rackspace, GoGrid and other cloud leaders, today have released their Simple API for Cloud Application Services project. The Simple Cloud API project empowers developers to use one interface to interact with the cloud services offered by different vendors. These vendors are all contributing to this open source project, making sure the Simple Cloud API “fits like a glove” on top of their service. Zend Cloud adapters will be available for services such as: Note that the Simple Cloud API is focused on providing a simple and re-usable interface across different cloud services. This implicates that specific features a service offers will not be available using the Simple Cloud API.
-
Joined The Lounge network
Last week, I received my invitation to the Lounge network, an exclusive advertising network for “trusted and respected publishers focused on Microsoft technologies”. First of all, it’s cool to see that at least someone considers me as trusted and respected. Next, it’s probably a better advertising solution than the Amazon ads I had earlier. The Lounge will always display ads related to .NET technology, whereas Amazon had its days of displaying lamps and home furniture enhancements. Let’s see how this works out.
-
ASP.NET MVC MvcSiteMapProvider 1.0 released
Back in March, I blogged about an experimental MvcSiteMap provider I was building. Today, I am proud to announce that it is stable enough to call it version 1.0! Download MvcSiteMapProvider 1.0 over at CodePlex. Ever since the source code release I did back in March, a lot of new features have been added, such as HtmlHelper extension methods, attributes, dynamic parameters, … I’ll leave most of them up to you to discover, but there are some I want to quickly highlight.
-
SQL Azure Manager
A few days ago, the SQL Server Team announced the availability of three major CTP’s and several new upcoming projects in the SQL related family tree: SQL Server 2008 R2, SQL Server StreamInsight and SQL Azure. Now that last one is interesting: Microsoft will offer a 1GB or 10GB database server “in the cloud” for a good price.
-
Book review: Beginning ASP.NET MVC 1.0
It sure looks like August 2009 is the month in which I found multiple books on my doormat for review. Last week I did ASP.NET 3.5 CMS Development, this time I’ll be reviewing a competitor to my own book on ASP.NET MVC, ASP.NET MVC 1.0 Quickly: Simone Chiaretta and Keyvan Nayyeri’s “Beginning ASP.NET MVC 1.0”. Let’s start with the “official book overview”, which I usually copy-paste from Amazon. This book will learn you: After doing some reading over the weekend, I can say this book is great! It follows a different path than most of the ASP.NET MVC books out there today: of course it offers the basic introduction to ASP.NET MVC, it talks about models, controllers, views, …, however: it also covers more advanced topics like dependency injection (using NInject).
-
ASP.NET MVC Chained Controller Factory
My last post on the REST for ASP.NET MVC SDK received an interesting comment… Basically, the spirit of the comment was: “There are tons of controller factories out there, but you can only use one at a time!”. This is true. One can have an IControllerFactory for MEF, for Castle Windsor, a custom one that creates a controller based on the current weather, … Most of the time, these IControllerFactory implementations do not glue together… Unless you chain them! The ChainedControllerFactory that I will be creating is quite easy: it builds a list of IControllerFactory instances that may be able to create an IController and asks them one by one to create it. The one that can create it, will be the one that delivers the controller. In code: [code:c#]
-
REST for ASP.NET MVC SDK
Earlier this week, Phil Haack did a post on the newly released REST for ASP.NET MVC SDK. I had the feeling though that this post did not really get the attention it deserved. I do not have the idea my blog gets more visitors than Phil’s, but I’ll try to give the SDK some more attention by blogging an example. But first things first… “REST for ASP .NET MVC is a set of capabilities that enable developers building a website using ASP .NET MVC to easily expose a Web API for the functionality of the site. “ Ok then. Now you know. It will get more clear after reading the next topic. There are of course features in WCF that enable you to build REST-ful services, but…
-
Book review: ASP.NET 3.5 CMS Development
From time to time, the people at Packt Publishing send me a free book, fresh of the presses, and ask nicely if I want to read it and write a review on my blog. Last week, I received their fresh ASP.NET 3.5 CMS Development book, written by Curt Christianson and Jeff Cochran, both Microsoft MVP (ASP.NET and IIS). According to the website, the book aims at learning people how to build a CMS. Now, I know from writing my ASP.NET MVC 1.0 Quickly book that these texts are written mostly by marketing people.
-
Signed Access Signatures and PHP SDK for Windows Azure
The latest Windows Azure storage release featured a new concept: “Shared Access Signatures”. The idea of those is that you can create signatures for specific resources in blob storage and that you can provide more granular access than the default “all-or-nothing” approach that is taken by Azure blob storage. Steve Marx posted a sample on this, demonstrating how you can provide read access to a blob for a specified amount of minutes, after which the access is revoked. The PHP SDK for Windows Azure is now equipped with a credentials mechanism, based on Signed Access Signatures. Let’s see if we can demonstrate how this would work… Let’s take Steve’s Wazdrop sample and upload a few files, we get a set of permissions:
-
Accessing ServiceConfiguration in FastCGI (PHP) web role
While working on a sample PHP application hosted on Windows Azure, I found that it is nearly impossible to retrieve information from the Windows Azure ServiceConfiguration.cscfg file. Also, it is impossible to write log messages to the Windows Azure Web Role. Well, both are not 100% impossible: you can imagine dirty hacks where you let a ASP.NET page do something from PHP and stuff like that. But how about a clean solution? How about… A PHP extension module? I’ll not be going into detail on how this module was built, but there is a native C++ RoleManager implementation in the Windows Azure samples. Using the resources listed below, I managed to create a PHP extension module, wrapping this RoleManager. The result? You can now retrieve configuration values from the ServiceConfiguration.
-
ASP.NET MVC 2 Preview 1 released!
Today, Phil Haack did a blog post on the release of ASP.NET MVC 2 Preview 1! Get it while it’s fresh :-) An updated roadmap is also available on CodePlex. Guess now is about time to start revising my ASP.NET MVC 1.0 Quickly book… Templated helpers are not new: ASP.NET Dynamic Data already used this feature. Basically, you are creating a default control when you want to display/edit a specific data type in a view. For example, a System.String will have a user control defined that renders a textbox. However, if you want this to be a TinyMCE control by default, you’ll have to change the templated helper in one place and you’re done. More concrete: create a new view in your application: Views\Shared\DisplayTemplates\String.ascx. The code for that view would be: [code:c#]
-
ReMIX Belgium session on ASP.NET MVC
Just learned I’ll be doing a session on ASP.NET MVC at ReMIX Belgium. ReMix brings the best of MIX09 in Las Vegas to Belgium: it bring us international speakers presenting on the best of MIX09, as well as local cases, with a story focus on User Experience (UX). The session will be around building a Twitter clone in 60 minutes. Bear with me at ReMIX 2009! Abstract: “What are you doing right now?, that's Twitter's question to its users. How about you creating own microblogging platform? "What are you working on?", "What are you reading?", ..., are all specific questions for your own community. This session takes you along in building a Twitter clone using the ASP.NET MVC framework.”
-
Query the cloud with PHP (PHPLinq and Windows Azure)
I’m pleased to announce PHPLinq currently supports basic querying of Windows Azure Table Storage. PHPLinq is a class library for PHP, based on the idea of Microsoft’s LINQ technology. LINQ is short for language integrated query, a component in the .NET framework which enables you to perform queries on a variety of data sources like arrays, XML, SQL server, ... These queries are defined using a syntax which is very similar to SQL. Next to PHPLinq querying arrays, XML and objects, which was already supported, PHPLinq now enables you to query Windows Azure Table Storage in the same manner as you would query a list of employees, simply by passing PHPLinq a Table Storage client and table name as storage hint in the in() method: [code:c#]
-
Authenticating users with RPXNow (in ASP.NET MVC)
Don’t you get sick of having to register at website X, at website Y, at website Z, …? It is really not fun to maintain all these accounts, change passwords, … Luckily, there are some large websites offering delegated sign-in (for example Google Accounts, Live ID, Twitter OAuth, …). You can use these delegated sign-in methods on your own site, removing the need of registering yet another account. Unfortunately, not everyone has an account at provider X…
-
PHP SDK for Windows Azure - Milestone 2 release
I’m proud to announce our second milestone for the PHP SDK for Windows Azure project that Microsoft and RealDolmen started back in May. Next to our regular releases on CodePlex, we’ll also be shipping a Zend Framework version of the PHP SDK for Windows Azure. Announcements on this will be made later. The current milestone is focused on Windows Azure Table Storage, enabling you to use all features this service offers from any PHP application, be it hosted in-premise or on Windows Azure. Get it while it’s hot: PHP SDK for Windows Azure CTP2 - PHPAzure CTP2 (0.2.0) Detailed API documentation is provided in the download package, while more descriptive guidance is available on the project site.
-
I’m an MVP ASP.NET!
Yesterday evening, I received the following e-mail: Dear Maarten Balliauw, Congratulations! We are pleased to present you with the 2009 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in ASP/ASP.NET technical communities during the past year. (...) Toby Richards General Manager Community Support Services Translated in short: I’m now officially an MVP ASP.NET! I am really honored to be recognized as an MVP. Thank you for the nomination!
-
How we built TwitterMatic.net - Part 7: Deploying to the cloud
“Knight Maarten The Brave Coffeedrinker had managed all there is to building an application to interact with the great god of social networking, Twitter. A barn in the cloud, worker roles, web roles, a gate keeper, … The moment of truth came near: would the application survive if it was thrown at the azure cloud? Would the digital villagers like the application?” This post is part of a series on how we built TwitterMatic.net. Other parts:
-
How we built TwitterMatic.net - Part 6: The back-end
“Now that the digital villagers could enter their messages in the application, another need arose: knight Maarten The Brave Coffeedrinker would have to recruit a lot of slaves to tell all these messages to the great god of social networking, Twitter. Being a peaceful person, our knight thought of some digital slaves, sent from the azure sky. And so he started crafting a worker role.” This post is part of a series on how we built TwitterMatic.net. Other parts: The worker role will monitor the table storage for scheduled Tweets. If it’s time to send them, the Tweet will be added to a queue. This queue is then processed by another thread in the worker role, which will publish the Tweet to Twitter. Well be using two threads for this:
-
How we built TwitterMatic.net - Part 5: the front-end
“After having found a god-like guardian for his application, Knight Maarten The Brave Coffeedrinker found out that his application still had no functional front-end. It’s OK to have a guardian and a barn in the cloud, but if there’s nothing to guard, this is a bit useless. Having asked the carpenter and the smith of the village, our knight decided that the so-called “ASP.NET MVC” framework might help in his quest.” This post is part of a series on how we built TwitterMatic.net. Other parts:
-
How we built TwitterMatic.net - Part 4: Authentication and membership
“Knight Maarten The Brave Coffeedrinker just returned from his quest to a barn in the clouds, when he discovered that he forgot to lock the door to his workplace. He immediately asked the digital village’s smith.to create a lock and provide him a key. Our knight returned to his workplace and concluded that using the smith’s lock would be OK, but having the great god of social networking, Twitter, as a guardian, seemed like a better idea. “O, Auth!”, he said. And the god provided him with a set of prayers, an API, which our knight could use.” This post is part of a series on how we built TwitterMatic.net. Other parts:
-
How we built TwitterMatic.net - Part 3: Store data in the cloud
“After setting up his workplace, knight Maarten The Brave Coffeedrinker thought of something else: if a farmer wants to keep a lot of hay, he needs a barn, right? Since the cloudy application would also need to keep things that can be used by the digital villagers, our knight needs a barn in the clouds. Looking at the azure sky, an idea popped into the knight’s head: why not use Windows Azure storage service? It’s a barn that’s always there, a barn that can catch fire and will still have its stored items located in a second barn (and a third). Knight Maarten The Brave Coffeedrinker jumped on his horse and went on a quest, a quest in the clouds.” This post is part of a series on how we built TwitterMatic.net. Other parts:
-
How we built TwitterMatic.net - Part 2: Creating an Azure project
“Knight Maarten The Brave Coffeedrinker was about to start working on his TwitterMatic application, named after the great god of social networking, Twitter. Before he could start working, he first needed the right tools. He downloaded the Windows Azure SDK, a set of tools recommended by the smith (or was it the carpenter?) of the digital village. Our knight’s work shack was soon ready to start working. The table on which the application would be crafted, was still empty. Time for action, the knight thought. And he started working.” This post is part of a series on how we built TwitterMatic.net. Other parts:
-
How we built TwitterMatic.net - Part 1: Introduction
“Once upon a time, Microsoft started a Windows Azure developing contest named new CloudApp();. While it first was only available for US candidates, the contest was opened for international submissions too. Knight Maarten The Brave Coffeedrinker and his fellow knightsmen at RealDolmen decided to submit a small sample application that could be hosted in an unknown environment, known by the digital villagers as “the cloud”. The application was called TwitterMatic, named after the great god of social networking, Twitter. It would allow digital villagers to tell the latest stories, even when they were asleep or busy working.”
-
Announcing: Azure User Group Belgium
After the summer, I'll be joining Kurt Claeys and Yves Goeleven and for the start of the Azure User Group Belgium (or AZUG.BE). AZUG.BE is a Belgian user group with focus on development and architecture of the Microsoft Azure Services Platform. Azure is a cloud hosted development platform for internet oriented applications aimed at high scalability and based on .NET technology. Our goal is to share knowledge and experiences with the .NET community in development and architecture in the Azure Services Platform and the .NET Services technology. As new programming skills and a new architectural approach are needed we are inviting you to become member of this user group to prepare you for building this new style of applications.
-
Application-wide action filters in ASP.NET MVC
Ever had a team of developers using your ASP.NET MVC framework? Chances are you have implemented some action filters (i.e. for logging) which should be applied on all controllers in the application. Two ways to do this: kindly ask your developers to add a [Logging] attribute to the controllers they write, or kindly ask to inherit from SomeCustomControllerWithActionsInPlace.
-
Revised: ASP.NET MVC and the Managed Extensibility Framework (MEF)
A while ago, I did a blog post on combining ASP.NET MVC and MEF (Managed Extensibility Framework), making it possible to “plug” controllers and views into your application as a module. I received a lot of positive feedback as well as a hard question from Dan Swatik who was experiencing a Server Error with this approach… Here’s a better approach to ASP.NET MVC and MEF. The stack trace was being quite verbose on this one:
-
ASP.NET MVC TDD using Visual Studio 2010
Phil Haack announced yesterday that the tooling support for ASP.NET MVC is available for Visual Studio 2010. Troy Goode already blogged about the designer snippets (which are really really cool, just like other parts of the roadmap for ASP.NET MVC 2.0). I’ll give the new TDD workflow introduced in VS2010 a take. First of all, I’ll create a new ASP.NET MVC application in VS2010. After installing the project template (and the designer snippets if you are cool), this is easy in VS2010: Proceed and make sure to create a unit test project as well. Next, in your unit test project, add a new unit test class and name it DemoControllerTests.cs. Go ahead and start typing the following test: Now when you type CTRL-. (or right click the DemoController unknown class), you can pick “Generate other…”:
-
A view from the cloud (or: locate your ASP.NET MVC views on Windows Azure Blob Storage)
Hosting and deploying ASP.NET MVC applications on Windows Azure works like a charm. However, if you have been reading my blog for a while, you might have seen that I don’t like the fact that my ASP.NET MVC views are stored in the deployed package as well… Why? If I want to change some text or I made a typo, I would have to re-deploy my entire application for this. Takes a while, application is down during deployment, … And all of that for a typo…
-
PHP and Silverlight - DevDays session
I just returned from The Hague where Kevin and I delivered a session on PHP and Silverlight. As promised, we are putting our slides and demos online. Download the demo code from here: PHP and Silverlight - DevDays.zip (1.00 mb) Abstract: We really enjoyed DevDays and want to thank everyone who was there (and was in our session while beer drinking seemed more appropriate that time of day).
-
ConnectedShow Podcast - PHP SDK for Windows Azure
The fifth episode of the ConnectedShow podcast is up. This podcast is all about cloud computing, Windows Azure, … Recently, they have asked me if I wanted to be in one of their podcasts on the PHP SDK for Windows Azure. In this episode Dmitry welcomes a new co-host, Peter Laudati. Next, we speak to Maarten Balliauw about the new PHP SDK for Windows Azure which is designed to help PHP developers use Windows Azure services. Here’s the link to the podcast: http://www.connectedshow.com/default.aspx?Episode=5
-
ASP.NET MVC Domain Routing
Ever since the release of ASP.NET MVC and its routing engine (System.Web.Routing), Microsoft has been trying to convince us that you have full control over your URL and routing. This is true to a certain extent: as long as it’s related to your application path, everything works out nicely. If you need to take care of data tokens in your (sub)domain, you’re screwed by default. Earlier this week, Juliën Hanssens did a blog post on his approach to subdomain routing. While this is a good a approach, it has some drawbacks: Unfortunately, the ASP.NET MVC infrastructure is based around this VirtualPathData class. That’s right: only tokens in the URL’s path are used for routing… Check my entry on the ASP.NET MVC forums on that one.
-
Document Interoperability Workshop, London, May 18 2009
After a pleasant flight with VLM airlines (Antwerp – London City), traveling under half of the city of London, I arrived at the Microsoft offices in Victoria for their third (?) DII workshop, of which I attended a previous one in Brussels last year. If you are wondering: “What are you doing there???”, here’s a short intro. I’ve been working on Microsoft interop projects for quite a few years now, like PHPExcel, PHPPowerPoint, PHPLinq, PHPAzure, … When working on PHPExcel and PHPPowerpoint, I hit the term “document interoperability” quite a lot. OpenXML (the underlying file format) is well documented, but there is some work on making sure the generated document by any of those tools is fully compatible with the standard. And that’s what these DII workshops are all about.
-
Mocking - VISUG session (screencast)
A new screencast has just been uploaded to the MSDN Belgium Chopsticks page. Don't forget to rate the video! Abstract: "This session provides an introduction to unit testing using mock objects. It builds a small application using TDD (test driven development). To enable easier unit testing, all dependencies are removed from code and introduced as mock objects. Afterwards, a mocking framework by the name of Moq (mock you) is used to shorten unit tests and create a maintainable set of unit tests for the example application. " Slides and example code can be found in my previous blog post on this session: Mocking - VISUG session
-
Announcing PHP SDK for Windows Azure
As part of Microsoft’s commitment to Interoperability, a new open source project has just been released on CodePlex: PHP SDK for Windows Azure, bridging PHP developers to Windows Azure. PHPAzure is an open source project to provide software development kit for Windows Azure and Windows Azure Storage – Blobs, Tables & Queues. I’m pleased that Microsoft has chosen RealDolmen and me to work on the PHP SDK for Windows Azure.
-
Mocking - VISUG session
Thursday evening, I did a session on Mocking for the VISUG (Visual Studio User Group Belgium). As promised, here is the slide deck I’ve used. The session will be available online soon, in the meantime you'll have to go with the slide deck. Demo code can also be downloaded: MockingDemoCode.zip (1.64 mb) Thank you for attending the session!
-
More ASP.NET MVC Best Practices
In this post, I’ll share some of the best practices and guidelines which I have come across while developing ASP.NET MVC web applications. I will not cover all best practices that are available, instead add some specific things that have not been mentioned in any blog post out there. Existing best practices can be found on Kazi Manzur Rashid’s blog and Simone Chiaretta’s blog: After reading the best practices above, read the following best practices. I assume you are familiar with the concept of model binders. If not, here’s a quick model binder 101: instead of having to write action methods like this (or a variant using FormCollection form[“xxxx”]): [code:c#] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Save() { // ...
-
Book review: Learning Ext JS
For a project at one of our customers, we’re building a rich web application using the Coolite web controls in ASP.NET MVC. Coolite is a great product, wrapping all Ext JS widgets in an ASP.NET control. Upon ordering a license for both, we received two free copies of Packt’s “Learning Ext JS”, providing better insight in what’s going on behind the curtains of Coolite.
-
PHPPowerPoint 0.1.0 (CTP1) released!
People following me on Twitter could have already guessed, but here’s something I probably should not have done for my agenda: next to the well known PHPExcel class library, I’ve now also started something similar for PowerPoint: PHPPowerPoint. Just like with PHPExcel, PHPPowerPoint can be used to generate PPTX files from a PHP application. This can be done by creating an in-memory presentation that consists of slides and different shapes, which can then be written to disk using a writer (of which there’s currently only one for PowerPoint 2007). Here’s some sample code: [code:c#] /* Create new PHPPowerPoint object */$objPHPPowerPoint = new PHPPowerPoint(); /* Create slide */$currentSlide = $objPHPPowerPoint->getActiveSlide();
-
MSDN session on ASP.NET MVC
As promised to all people attending my online session on ASP.NET MVC this afternoon, here is the slide deck I’ve used. I must say, doing a presentation using Live Meeting and a Microsoft Roundtable device seemed a bit strange at first. However, the setup that is used to do this kind of sessions is really cool to work with! Make sure to check Katrien’s blog for all other Live Meeting MSDN sessions that are planned.
-
ASP.NET MVC and the Managed Extensibility Framework (MEF)
Microsoft’s Managed Extensibility Framework (MEF) is a .NET library (released on CodePlex) that enables greater re-use of application components. You can do this by dynamically composing your application based on a set of classes and methods that can be combined at runtime. Think of it like building an appliation that can host plugins, which in turn can also be composed of different plugins. Since examples say a thousand times more than text, let’s go ahead with a sample leveraging MEF in an ASP.NET MVC web application. The Managed Extensibility Framework can be downloaded from the CodePlex website. In the download, you’ll find the full source code, binaries and some examples demonstrating different use cases for MEF.
-
Using the ASP.NET MVC Futures AsyncController
Last week, I blogged about all stuff that is included in the ASP.NET MVC Futures assembly, which is an assembly available on CodePlex and contains possible future features (tonguetwister!) for the ASP.NET MVC framework. One of the comments asked for more information on the AsyncController that is introduced in the MVC Futures. So here goes!
-
Speaking at DevDays 2009, The Hague (and more)
Some Great news (at least: I think this is great :-)): Kevin Dockx and I will be giving a session on PHP and Silverlight at the Netherlands DevDays09. This event, aimed totally at developers, will take place on May 28 and 29th in The Hague (Den Haag). It’s the first time the DevDays are hosting sessions related to PHP, and it’s also the first time I’ll be speaking at an event of this size. Our session will cover the basics of Silverlight and show you how you can create rich web applications using the best of 2 worlds: Silverlight and PHP. Next to this event, we’ll be doing this very same session at the Dutch PHP Conference in Amsterdam, which will take place June 11 – June 13th. Yes, we are evil, doing a presentation on Microsoft technologies at a PHP event.
-
Back to the future! Exploring ASP.NET MVC Futures
For those of you who did not know yet: next to the ASP.NET MVC 1.0 version and its source code, there’s also an interesting assembly available if you can not wait for next versions of the ASP.NET MVC framework: the MVC Futures assembly. In this blog post, I’ll provide you with a quick overview of what is available in this assembly and how you can already benefit from… “the future”. First things first: where to get this thing? You can download the assembly from the CodePlex releases page. Afterwards, reference this assembly in your ASP.NET MVC web application. Also add some things to the Web.config file of your application: [code:c#] <?xml version="1.0"?> <configuration> <!-- ... --> <system.web> <!-- ... -->
-
New CodePlex project: MvcSiteMap – ASP.NET MVC sitemap provider
If you have been using the ASP.NET MVC framework, you possibly have been searching for something like the classic ASP.NET sitemap. After you've played with it, you even found it useful! But not really flexible and easy to map to routes and controllers. To tackle that, last year, somewhere in August, I released a proof-of-concept sitemap provider for the ASP.NET MVC framework on my blog. The blog post on sitemap provider I released back then has received numerous comments, suggestions, code snippets, … Together with Patrice Calve, we’ve released a new version of the sitemap provider on CodePlex: MvcSiteMap. This time I’ll not dive into implementation details, but provide you with some of the features our sitemap provider erm… provides.
-
Sample chapter from ASP.NET MVC 1.0 Quickly
Here’s a shameless, commercial blogpost… With yesterday’s 1.0 release of the ASP.NET MVC framework, I’m sure the following sample chapter from my book ASP.NET MVC 1.0 Quickly will be of use for people starting ASP.NET MVC development: Your first ASP.NET MVC application.
-
ASP.NET MVC 1.0 has been released!
To keep up with a good tradition (see here and here), I have some great news on ASP.NET MVC: we are at version 1.0! This means production ready, supported, stable, …! Grab the download at Microsoft.com. I’m expecting an epic blog post by the Gu, but here’s some stuff you may want to have a look at: all my posts on ASP.NET MVC. Another thing you can do: order my book on ASP.NET MVC :-) We’ve released the print version yesterday, meaning you are now completely set to start developing with ASP.NET MVC. Edit: Looks like Simone was equally fast :-) And Kris. Edit: More from MIX: Silverlight 3 SDK Beta 1 is already up! http://tinyurl.com/crfogs
-
Accessing Windows Azure Blob Storage from PHP
Pfew! A week of Microsoft TechDays here in Belgium with lots of talks on new Microsoft stuff, Azure included. You may know I already experimented with Windows Azure and ASP.NET MVC. Earlier this week, I thought of doing the same with Windows Azure and PHP... At Microsoft PDC 2008, the Azure Services Platform was announced in the opening keynote. Azure is the name for Microsoft’s Software + Services platform, an operating system in the cloud providing services for hosting, management, scalable storage with support for simple blobs, tables, and queues, as well as a management infrastructure for provisioning and geo-distribution of cloud-based services, and a development platform for the Azure Services layer.
-
CRUD with ASP.NET MVC (screencast)
A new screencast has just been uploaded to the MSDN Belgium Chopsticks page. Don't forget to rate the video! Abstract: "In this video, the new tooling for Visual Studio included in ASP.NET MVC release candidate is demonstrated to create a create, read, update and delete user interface within 15 minutes."
-
Creating an ASP.NET MVC application with Google Gears
Offline web applications… This term really sounds like 2 different things: offline, no network, and web application, online. Maarten, you speak in riddles man! Let me explain the term… You probably have been working with Gmail or Google Docs. One of the features with those web applications is that they provide an “offline mode”, which allows you to access your e-mail and documents locally, when an Internet connection is not available. When a connection is available, those items are synchronized between your PC and the application server. This offline functionality is built using JavaScript and a Google product called Google Gears. In this blog post, I will be building a simple notebook application using the ASP.NET MVC framework, and afterwards make it available to be used offline.
-
Announcing my book: ASP.NET MVC 1.0 Quickly
It’s been quite a job, but there it is: Packt just announced my very first book on their site. It is titled “ASP.NET MVC 1.0 Quickly”, covering all aspects ASP.NET MVC offers in a to-the-point manner with hands-on examples. The book walks through the main concepts of the MVC framework to help existing ASP.NET developers to move on to a higher level. It includes clear instructions and lots of code examples. It takes a simple approach, thereby allowing you to work with all facets of web application development. Some keywords: Model-view-controller, ASP.NET MVC architecture and components, unit testing, mocking, AJAX using MS Ajax and jQuery, reference application and resources.
-
Replacement during my vacation: Wilson
This morning, I arrived at work after a great week of skiing in Pitztal, Austria. Unfortunately, I found my chair occupied by a new colleague looking a bit like Wilson. Good to see he enjoyed working early, like I do. But still, that was my seat and PC he was using… Thank you, dear colleagues, to see myself replaced by a plastic, smiling ball…
-
Book review: Software Testing with Visual Studio Team System 2008
Another book review, this time for Packt’s “Software Testing with Visual Studio Team System 2008”. The book introduces you to the main types of testing available in Visual Studio Team System 2008 for both desktop and web applications, and then walks you through deploying, running, and interpreting the results of tests. The book starts with an overview of why you need testing and then lists all available test types in Visual Studio 2008. It also explains the differences between a stand alone Visual Studio 2008 and a Team Foundation Server backed version. Each chapter thereafter covers one of the test types in detail: unit tests, web tests, advanced web tests, load tests, manual tests, …
-
Saving a PHPExcel spreadsheet to Google Documents
As you may know, PHPExcel is built using an extensible model, supporting different input and output formats. The PHPExcel core class library features a spreadsheet engine, which is supported by IReader and IWriter instances used for reading and writing a spreadsheet to/from a file. Currently, PHPExcel supports writers for Excel2007, Excel5 (Excel 97+), CSV, HTML and PDF. Wouldnt it be nice if we could use PHPExcel to store a spreadsheet on Google Documents? Let’s combine some technologies: First, we need an implementation of PHPExcel_Writer_IWriter which will support writing stuff to Google Documents. Since Google accepts XLS files and Zend_Gdata provides an upload method, I think an overloaded version of PHPExcel’s integrated PHPExcel_Writer_Excel5 will be a good starting point. [code:c#]
-
New VISUG website online
Last week, the new VISUG website has been released. VISUG stands for Visual Studio User Group Belgium and is one of the largest .NET related user groups in Belgium, providing technical sessions on different .NET related topics. This new site not only features a new layout, but also some new features. One of the most useful features is that there now is finally an RSS feed listing upcoming events (such as 19 Februari’s Live Mesh event). The front page now also syndicates blog feeds from different members of the user group, containing lots of useful information regarding .NET. That being said, also check the new MSCommunity site which is a new website that gathers all event information for the main Microsoft user groups in Belgium (Sharepoint, SQL server, ITPro, …)
-
Form validation with ASP.NET MVC release candidate
Last week, the ASP.NET MVC framework release candidate was released (check ScottGu’s post). Apart from some great new tooling support, form validation has never been easier. Here’s a quick introduction. Imagine we have a LINQ to SQL data model, containing an Employee from the Northwind database. As you may know, LINQ to SQL will generate this Employee class as a partial class, which we can use to extend this domain object’s behaviour. Let’s extend this class with an interface implementation for IDataErrorInfo. [code:c#] public partial class Employee : IDataErrorInfo { #region IDataErrorInfo Members public string Error { get { throw new NotImplementedException(); } }
-
PHPLinq 0.4.0 released on CodePlex!
I’m pleased to announce that PHPLinq 0.4.0 has been released on CodePlex. PHPLinq is currently one year old, and I decided to add a huge step in functionality for the 0.4.0 release. This blog post will focus on the current status of PHPLinq and what it is capable of doing for you in a PHP project. PHPLinq is a class library for PHP, based on the idea of Microsoft’s LINQ technology. LINQ is short for language integrated query, a component in the .NET framework which enables you to perform queries on a variety of data sources like arrays, XML, SQL server, ... These queries are defined using a syntax which is very similar to SQL.
-
TechDays 2009 agenda has been posted!
Just a quick note: the Belgian TechDays 2009 agenda has been published. You can find it on the TechDays website. Also, Katrien has posted some more details on the agenda on her blog. Hope to see you at the TechDays in Antwerp!
-
Updated CarTrackr to ASP.NET MVC RC
As you may have noticed, ASP.NET MVC 1.0 Release Candidate has been released over the night. You can read all about it in ScottGu’s blog post, covering all new tools that have been released with the RC. Since I’ve been trying to maintain a small reference application for ASP.NET MVC known as CarTrackr, I have updated the source code to reflect some changes in the ASP.NET MVC RC. You can download it directly from the CodePlex project page at www.cartrackr.net. Here’s what I have updated (copied from the release notes): The templates for ViewPage, ViewMasterPage, and ViewUserControl (and derived types) now support language-specific generic syntax in the main directive’s Inherits attribute. For example, you can specify the following type in the @ Master directive: [code:xml]
-
ECMA-376 implementation notes are out
Last month, Microsoft released the implementation notes for their ODF implementation in Office 2007. These implementation notes are actually the documentation on how Office 2007 treats ODF documents in various cases. Today, Microsoft released the ECMA-376 implementation notes, or in short: they've now documented how Office 2007 handles OpenXML documents. The implementation notes site can be found on www.documentinteropinitiative.org.
-
Book review: ASP.NET 3.5 Social Networking
Last week, I found another book from Packt in my letterbox. This time, the title is ASP.NET 3.5 Social Networking, written by Andrew Siemer. On the back cover, I read that this book shows you how to create a scalable, maintainable social network that can support hundreds of thousands of users, multimedia features and stuff like that. The words scalable and maintainable seem to have triggered me: I started reading ASAP. The first chapter talks about what a social network is and proposes a new social network: Fisharoo.com, a web site for salt water aquarium fanatics, complete with blogs, forums, personal web sites, …
-
Checking username availability with jQuery (screencast)
A new screencast has just been uploaded to the MSDN Belgium Chopsticks page. Don't forget to rate the video! Abstract: "This screencast explains how to use jQuery and the ASP.NET MVC framework to quickly add a username availability checker to a user registration page."
-
Verifying code and testing with Pex
Earlier this week, Katrien posted an update on the list of Belgian TechDays 2009 speakers. This post featured a summary on all sessions, of which one was titled “Pex – Automated White Box Testing for .NET”. Here’s the abstract:
-
Seven things you didn’t know about me
Seems 2009 is starting off with yet another round of tagging people. Back in 2007, I already had to write five things about myself. Since we are now two years further, I guess each year asks for another extra item to be added. Thank you Michelangelo for making me write another post. Here goes, seven things you may not know about me: Since almost everyone I know in PHP land has been tagged, let’s also tag some people outside PHP land: Here are the rules if you are tagged:
-
Top blog posts in 2008
Since everyone (that is Simone Chiaretta and Phil Haack) seems to be blogging about 2008 and their top posts, here’s my list. 1. Reuse Excel business logic with PHPExcel – This post explains how to use PHPExcel in a business scenario where a spreadsheet contains calculation logic which is used in a PHP application. 2. Code performance analysis in Visual Studio 2008 - Visual Studio developer, did you know you have a great performance analysis (profiling) tool at your fingertips? 3. ASP.NET load balancing and ASP.NET state server (aspnet_state) – A how-to on load balancing with ASP.NET. Also related to ASP.NET Session State Partitioning and ASP.NET Session State Partitioning using State Server Load Balancing.
-
Book review: ASP.NET 3.5 Application Architecture and Design
The people at Packt asked it again: “Do you want to review this book?” Sure I do! The book I’m reviewing this time is ASP.NET 3.5 Application Architecture and Design, written by Vivek Thakur.
-
CarTrackr on Windows Azure - Part 5 - Deploying in the cloud
This post is part 5 (and the final part) of my series on Windows Azure, in which I'll try to convert my ASP.NET MVC application into a cloud application. The current post is all about deploying CarTrackr in the cloud after all modifications done in previous posts. Other parts: Deploying CarTrackr is done using the Azure developer portal. I'm creating a hosted service named "CarTrackr", which will host the cloud version of CarTrackr. I'm also creating a second storage acocunt project, used for TableStorage of all data in CarTrackr.
-
CarTrackr on Windows Azure - Part 4 - Membership and authentication
This post is part 4 of my series on Windows Azure, in which I'll try to convert my ASP.NET MVC application into a cloud application. The current post is all about implementing authentication in CarTrackr. Other parts: In my opening post on this series, i defined some tasks which i would probably have to do prior to being able to run cartrackr on azure. for membership and authentication, i defined 2 solutions: cloudship or Windows Live ID. At first, Cloudship looked really nice as it is just an implementation of ASP.NET's provider model based on Azure. Some thinking cycles later, this did not feel right for CarTrackr... For CarTrackr, authentication only would be enough, membership would be real overkill.
-
CarTrackr on Windows Azure - Part 3 - Data storage
This post is part 3 of my series on Windows Azure, in which I'll try to convert my ASP.NET MVC application into a cloud application. The current post is all about implementing cloud storage in CarTrackr. Other parts: Windows Azure offers 3 types of cloud storage: blobs, tables and queues. Blob Storage stores sets of binary data, organized in containers of your storage account. Table Storage offers structured storage in the form of tables. The Queue service stores an unlimited number of messages, each of which can be up to 8 KB in size.
-
Microsoft launches Implementation Notes (for ODF)
Just a quick post: at the Document Operability workshop in Brussels on December 2, Microsoft already announced they were going to do something with implementation notes. Here’s a scoop from my blog post on that:
-
CarTrackr on Windows Azure - Part 2 - Cloud-enabling CarTrackr
This post is part 2 of my series on Windows Azure, in which I'll try to convert my ASP.NET MVC application into a cloud application. The current post is all about enabling the CarTrackr Visual Studio Solution file for Windows Azure. Other parts: For a blank Azure application, one would choose the Web Cloud Service type project (installed with teh Azure CTP), which brings up two projects in the solution: a <project> and <project>_WebRole. The first one is teh service definition, the latter is the actual application. Since CarTrackr is an existing project, let's add a new CarTrackr_Azure project containing the service definition.
-
Track your car expenses in the cloud! CarTrackr on Windows Azure - Part 1 - Introduction
As you may see in the title, I will be starting a series on modifying my CarTrackr sample application to a cloud-based, Windows Azure application. At this point, I don't know if it's easy nor do I know what it takes to achieve this goal. I only have some assumtions on how CarTrackr can be converted to a cloud application. This post is part 1 of the series, in which I'll describe the architecture of Windows Azure and what I think it takes to convert my ASP.NET MVC application into a cloud application. Other parts:
-
New Entity Framework / LINQ blog!
Just a quick recommendation note: One of my colleagues, Julien Hanssens, has started blogging on his experiences with the Entity Framework and LINQ. Here are some links to get you started:
-
ASP.NET MVC XForms released on CodePlex
Just noticed there's a new project on CodePlex related to the ASP.NET MVC framework: MVC XForms. MVC XForms is a simple UI framework for ASP.NET MVC based on the W3C XForms specification. It provides a set of form controls that allow updating of complex model objects. Picked these project goals from Jon Curtis' blog: I haven't gone into any advanced scenario's, but have instead used a simple case to demonstrate some of the MVC XForms basics. First of all, I've created a Person class with an Id (int), Name (string) and BirthDate (DateTime). This class is used by a specific view in my application, of which the view markup looks like this:
-
OpenXML DII workshop Brussels - Quick summary
A few days ago, I wrote I was doing a presentation on the DII workshop in Brussels together with Julien Chable. Apart from heavy traffic from Antwerp to Brussels (80km, almost 3 hours... *sigh*), I think the DII workshop was quite succesful! Lots of news around OpenXML and Office, lots of interesting ideas from other community members. It was also great to meet some people who I've been mailing with for 2 years in person. Slides of the Redmond DII session can be found here.
-
PHPExcel featured in php|architect / November 2008
Nice to see that there's a lot of activity going on related to PHPExcel! This weekend, I receievd my electronic copy of php|architect / November 2008 featuring an article on generating PDF and Excel files using PHP. Guess which library is being used in the second part of the article... While reading the article, I noticed a very cool thing: the author, Aaron Wormus, is using a convenient way to generate charts in PHPExcel using Google Charts API. Since PHPExcel currently does not support creating graphs, this is really a good method to use charts in PHPExcel generated Excel files. Here's a screenshot of the generated file in the magazine: Sweet!
-
Presenting at the OpenXML DII workshop Brussels
First things first: WTF is DII??? It's the "Document Interoperability Initiative" that Microsoft launched. The workshop will be a day filled with presentations from a variety of people, including members of the Office product groups at Microsoft and developers and consultants from several other companies (basically like the one held in Redmond a few weeks ago). Together with Julien Chable, I'll be doing a talk on "Document Interop from an Open Source perspective - PHPExcel and OPENXML4J". Both our open-source products PHPExcel and OPENXML4J will be highlighted with some background and technical demos. We will prove that OpenXML documents provide interoperability between platforms (Windows / Linux) and technologies (.NET, PHP and Java). Hope to see you there next tuesday!
-
Using the ASP.NET MVC ModelBinder (screencast)
A new screencast has just been uploaded to the MSDN Belgium Chopsticks page. Don't forget to rate the video! Abstract: "This screencast demonstrates how code can be made more maintainable and testable by delegating binding to client data to the ASP.NET MVC model binder architecture."
-
Partial page updates with ASP.NET MVC and jQuery (and action filters)
When building an ASP.NET MVC application, chances are that you are using master pages. After working on the application for a while, it's time to spice up some views with jQuery and partial updates. Let's start with an example application which does not have any Ajax / jQuery. Our company's website shows a list of all employees and provides a link to a details page containing a bio for that employee. In the current situation, this link is referring to a custom action method which is rendered on a separate page. The company website could be made a little sexier... What about fetching the employee details using an Ajax call and rendering the details in the employee list? Yes, that's actually what classic ASP.NET's UpdatePanel does. Let's do that with jQuery instead.
-
OpenXML support in Zend Framework 1.7 Lucene indexer
It has indeed been a long time since I blogged about OpenXML. However, this does not mean I'm completely doing nothing with it! PHPExcel still keeps eating a lot of evening hours as well as some other OpenXML-related projects. The folks at Zend contacted me if I would be interested in implementing OpenXML indexers for the Zend Framework Lucene Indexer. I've blogged about indexing OpenXML files once before, but since today's Zend Framework 1.7 release, indexing OpenXML documents is as easy as indexing any other natively supported file format. Want to know how? Check the documentation in the manual at http://framework.zend.com/manual/en/zend.search.lucene.html.
-
Integrating NUnit test results in Team Build 2008
When using Team Foundation Server 2008 and Team Build, chances are you are developing unit tests in Microsoft’s test framework which is integrated with Visual Studio 2008. This integration offers valuable data hen a build has been finished on the build server: test run results are published in the Team Foundation Server 2008 data warehouse and can be used to create detailed metrics on how your development team is performing and what the quality of the product being developed is.
-
Creating a generic Linq to SQL ModelBinder for the ASP.NET MVC framework
You are right! This is indeed my third post on ASP.NET MVC ModelBinders. The first one focussed on creating a ModelBinder from scratch in an older preview release, the second post did something similar trying to do some dirty ViewState-like stuff. Good news! There's more of this dirty stuff coming! How about this action method, using a Person class which is a Linq to SQL entity type: [code:c#] public ActionResult PersonDetails(Person id) { if (id == null) return RedirectToAction("Index"); return View(id); } [/code]
-
CarTrackr - Sample ASP.NET MVC application
Some people may have already noticed the link in my VISUG session blog post, but for those who didn't... I've released my sample application CarTrackr on CodePlex. CarTrackr is a sample application for the ASP.NET MVC framework using the repository pattern and dependency injection using the Unity application block. It was written for various demos in presentations done by Maarten Balliauw. CarTrackr is an online software application designed to help you understand and track your fuel usage and kilometers driven. You will have a record on when you filled up on fuel, how many kilometers you got in a given tank, how much you spent and how much liters of fuel you are using per 100 kilometer.
-
Introduction to ASP.NET MVC for VISUG - Presentation materials
Yesterday evening, I did a presentation on the ASP.NET MVC framework for VISUG (Visual Studio User Group Belgium). I really hope everyone got a good feel on what the ASP.NET MVC framework is all about and what it takes to build an ASP.NET MVC application. Thank you Pieter Gheysens for inviting me for this talk! And thank you audience for being interested for over an hour and a half! A recorded version of this presentation will be available later, for the moment you'll have to do with the presentation materials. The download contains the slides, the Hello World application and the testing demo. The CarTrackr application can be found on CodePlex. Presentation materials: VISUG ASP.NET MVC materials.zip (5.63 mb) CarTrackr sample application: http://www.codeplex.com/CarTrackr/
-
Using the ASP.NET MVC ModelBinder attribute - Second part
Just after the ASP.NET MVC preview 5 was released, I made a quick attempt to using the ModelBinder attribute. In short, a ModelBinder allows you to use complex objects as action method parameters, instead of just basic types like strings and integers. While my aproach was correct, it did not really cover the whole picture. So here it is: the full picture. First of all, what are these model binders all about? By default, an action method would look like this: [code:c#] public ActionResult Edit(int personId) { // ... fetch Person and do stuff } [/code] Now wouldn't it be nice to pass this Person object completely as a parameter, rather than obliging the controller's action method to process an id? Think of this: [code:c#]
-
Forms interaction with ASP.NET MVC (screencast)
Abstract: "This screencast is a short demonstration on how you can handle form interactions using the ASP.NET MVC framework." Download sample code: MvcCommentForm.zip (593.58 kb)
-
ASP.NET MVC preview 5's AntiForgeryToken helper method and attribute
The new ASP.NET MVC preview 5 featured a number of new HtmlHelper methods. One of these methods is the HtmlHelper.AntiForgeryToken. When you place <%=Html.AntiForgeryToken()%> on your view, this will be rendered similar to the following: [code:c#] <input name="__MVC_AntiForgeryToken" type="hidden" value="Ak8uFC1MQcl2DXfJyOM4DDL0zvqc93fTJd+tYxaBN6aIGvwOzL8MA6TDWTj1rRTq" /> [/code] When using this in conjunction with the action filter attribute [ValidateAntiForgeryToken], each round trip to the server will be validated based on this token. [code:c#] [ValidateAntiForgeryToken] public ActionResult Update(int? id, string name, string email) { // ... } [/code]
-
Using the ASP.NET MVC ModelBinder attribute
ASP.NET MVC action methods can be developed using regular method parameters. In earlier versions of the ASP.NET MVC framework, these parameters were all simple types like integers, strings, booleans, … When required, a method parameter can be a complex type like a Contact with Name, Email and Message properties. It is, however, required to add a ModelBinder attribute in this case. Here’s how a controller action method could look like: [code:c#] public ActionResult Contact([ModelBinder(typeof(ContactBinder))]Contact contact) { // Add data to view ViewData["name"] = contact.Name; ViewData["email"] = contact.Email; ViewData["message"] = contact.Message; ViewData["title"] = "Succes!"; // Done! return View(); } [/code]
-
Form validation with ASP.NET MVC preview 5
In earlier ASP.NET MVC previews, form validation was something that should be implemented "by hand". Since the new ASP.NET MVC preview 5, form validation has become more handy. Let me show you how you can add validation in such a ridiculously easy manner. Here's an example controller: [code:c#] using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Mvc.Ajax; namespace ValidationExample.Controllers { [HandleError] public class HomeController : Controller { // ... some other action methods ... [AcceptVerbs("GET")] public ActionResult Contact() { return View(); }
-
Building an ASP.NET MVC sitemap provider with security trimming
Warning!A new version of the source code provided in this post is available here. Use this blog post as reference only. Yes, it has been a while since my last post. A nice vacation to Austria, some work to catch up, ... All excuses, I know, but I'll make it up to you with a huge blog post! If you have been using the ASP.NET MVC framework, you possibly have been searching for something like the classic ASP.NET sitemap. After you've played with it, you even found it useful! But not really flexible and easy to map to routes and controllers. Sounds familiar? Continue reading! Doesn't ring a bell? Well, continue reading, please! Feel free to download the sample code. UPDATE: A version for preview 5 can also be downloaded: MvcSitemapProvider.cs (19.46 kb)
-
MSDN Chopsticks on ASP.NET MVC (screencasts)
A while ago, KatrienDG asked me to do some screencasts on the ASP.NET MVC framework for the MSDN Chopsticks page. I've been working on 2 screencasts: an introductory talk to the ASP.NET MVC framework and a Test Driven Development story. Feel free to leave some comments! Abstract: "The ASP.NET MVC framework is a new approach to web development, based on the model-view-controller design pattern. Microsoft built this framework on top of ASP.NET to allow this alternative to work with existing features like membership caching, user controls... In this video, Maarten shows you some basics on the ASP.NET MVC framework like creating a new controller action and a view."
-
ASP.NET MVC - Upcoming preview 4 release
ScottGu just posted that there's an upcoming preview 4 release of the ASP.NET MVC framework. What I immediately noticed, is that there are actually some community concepts being integrated in the framework, yay! And what's even cooler: 2 of these new features are things that I've already contributed to the community (the fact that it these are included in the MVC framework now could be coincidence, though...). Thank you, ASP.NET MVC team! This preview 4 release seems like a great step in the evolution of the ASP.NET MVC framework. Thumbs up!
-
Article on ASP.NET MVC in .NET magazine #21
Yesterday, I received the new Dutch edition of .NET magazine containing my article on the ASP.NET MVC framework. Since the article was written quite a while ago, soucre code is no longer up-to-date. Readers who are interested (or anyone else interested in ASP.NET MVC) can download up-to-date code examples on the ASP.NET MVC guestbook page.
-
Extending ASP.NET MVC OutputCache ActionFilterAttribute - Adding substitution
In my previous blog post on ASP.NET MVC OutputCache, not all aspects of "classic" ASP.NET output caching were covered. For instance, substitution of cached pages. Allow me to explain... When using output caching you might want to have everything cached, except, for example, a user's login name or a time stamp. When caching a full HTTP response, it is not really possible to inject dynamic data. ASP.NET introduced the Substitution control, which allows parts of a cached response to be dynamic. The contents of the Substitution control are dynamically injected after retrieving cached data, by calling a certain static method which returns string data. Now let's build this into my OutputCache ActionFilterAttribute...
-
Creating an ASP.NET MVC OutputCache ActionFilterAttribute
In every web application, there are situations where you want to cache the HTML output of a specific page for a certain amount of time, because underlying data and processing isn't really subject to changes a lot. This cached response is stored in the web server's memory and offers very fast responses because no additional processing is required. Using "classic" ASP.NET, one can use the OutputCache directive on a .aspx page to tell the ASP.NET runtime to cache the response data for a specific amount of time. Optionally, caching may vary by parameter, which results in different cached responses depending on the parameters that were passed in the URL.
-
The devil is in the details (Visual Studio Team System test policy)
Have you ever been in a difficult situation where a software product is overall very good, but a small detail is going wrong? At least I've been, for the past week... Team System allows check-in policies to be enforced prior to checking in your code. One of these policies is the unit testing policy, which allows you to enforce a specific test list to be run prior to checking in your code. Now here's the catch: what if you have a Team Project with 2 solutions in it? How can I enforce the check-in policy to run tests from solution A only when something in solution A is checked in, tests from solution B with solution B changes, ...
-
Code based ASP.NET MVC GridView
Earlier this week a colleague of mine asked me if there was such thing as a DataGrid or GridView or something like that in the ASP.NET MVC framework. My first answer was: "Nope!". I advised him to look for a nice foreach implementation or using ExtJS, Dojo or similar. Which made me think... Why not create a simple GridView extension method which generates a nice looking, plain-HTML grid with all required features like paging, editing, deleting, alternating rows, ...?
-
Detailed code metrics with NDepend
A while ago, I blogged about code performance analysis in Visual Studio 2008. Using profiling and hot path tracking, I measured code performance and was able to react to that. Last week, Patrick Smacchia contacted me asking if I wanted to test his project NDepend. He promised me NDepend would provide more insight in my applications. Let's test that! After downloading, extracting and starting NDepend, an almost familiar interface shows up. Unfortunately, the interface that shows up after analyzing a set of assemblies is a little bit overwhelming... Note that this overwhelming feeling fades away after 15 minutes: the interface shows the information you want in a very efficient way! Here's the analysis of a personal "wine tracking" application I wrote 2 years ago.
-
ASP.NET MVC framework preview 3 released!
Don't know how I do it, but I think this blog post is yet again the first one out there mentioning a new release of the ASP.NET framework (preview 3) The official installation package can be downloaded from the Microsoft site. Source code is also available from CodePlex. Update instructions from preview 2 to preview 3 are contained in the download. If you created a project based on the "preview-preview" version, here's what you'll have to update:
-
Creating a custom ViewEngine for the ASP.NET MVC framework
Have you ever seen a presentation of ScottGu about the ASP.NET MVC framework? There is one particular slide that keeps coming back, stating that every step in the ASP.NET MVC life cycle is pluggable. Let's find out if replacing one of these components is actually easy by creating a custom ViewEngine and corresponding view. After a route has been determined by the route handler, a Controller is fired up. This Controller sets ViewData, which is afterwards passed into the ViewEngine. In short, the ViewEngine processes the view and provides the view with ViewData from the Controller. Here's the base class: [code:c#] public abstract class ViewEngineBase { public abstract void RenderView(ViewContext viewContext); } [/code]
-
ASP.NET MVC custom ActionResult (ImageResult)
The ASP.NET MVC framework introduces the concept of returning an ActionResult in Controllers since the "preview preview" release on CodePlex. The purpose of this concept is to return a generic ActionResult object for each Controller method, allowing different child classes returning different results. An example ActionResult (built-in) is the RenderViewResult. Whenever you want to render a view, you can simply return an object of this class which will render a specific view in its ExecuteResult method. Another example is the HttpRedirectResult which will output an HTTP header (Location: /SomethingElse.aspx).
-
Having fun with project managers! (or: why you should lock your desktop)
Have you ever left your computer unattended? (I do hope that!) Do you lock your desktop when this occurs? (I hope so either!) Not locking your desktop can be a risk. Your data might get stolen, someone might install a trojan, ... My project manager is one of those people who do not lock their computer when away. After having explained that this is a very simple thing he still seems to forget it everytime. Since a few weeks, we are using some more persuasive manners to teach him to press the Windows-key + L whenever he leaves his computer. Some practical jokes...
-
Finally! My own custom BlogEngine.net template!
Right after my blog move to BlogEngine.net, I decided to create a custom template for my blog to make it more unique in the blogosphere. Less than a year later (11 months, to be precise) I found the time to fire up my HTML and image editor to create a new look for my blog. Now who said developers are lazy?
-
New Team Foundation Server projects on CodePlex!
Busy times... Lots of work, some holidays here in Belgium, ... But there's always time to browse CodePlex! It is actually a good thing to do that from time to time. In the past few days, I spotted two great new projects on Team Foundation Server. Thumbs up for their authors! "Use this Visual Studio Add-In to leverage Team System and the Visual Studio code object model for in-IDE code review feedback, demonstration, and review replay. The inspiration for this project are the many code reviews we've experienced that have been generally underwhelming experiences and less than optimal outcomes. To make code review less painful, and to greatly assist in distributed environment code reviews this project will add Code Review squarely into the VS.Net Team System tools."
-
Zend Studio + Teamprise = PHP development with Team Foundation Server
Ever since I started developing PHPExcel, I noticed this option of connecting to CodePlex's Team Foundation Server using Teamprise for Eclipse (free CodePlex license here). Back in the days, I was developing using Zend Studio 4, but I recently upgraded to Zend Studio 6 for Eclipse. Now this "Eclipse" word triggered the idea that perhaps integration of Zend Studio and Team Foundation Server could be something that works. So I downloaded the Teamprise Eclipse plugin package, copied it to the Zend Studio plugins ditrectory. And yes: tight integration of Team Foundation Server with Zend Studio is possible! Let's rephrase that: it is perfectly possible to use Team Foundation Server in a mixed Microsoft / PHP development team as your main store for source control, work items, reporting, ...
-
ASP.Net MVC Membership Starter Kit alternative authentication
Last week, I blogged about the ASP.Net MVC Membership Starter Kit and some of its features. Since then, Troy Goode and I are developing at warp-speed to provide a complete (Forms)Authentication starter kit for the MVC framework. Scott Guthrie also noticed our efforts, which forced us to do an official release earlier than planned. Now when I say warp-speed, here's what to think of: we added Visual Studio item templates, a nice setup program, a demo application, ... We started with FormsAuthentication, but we have evolved into some alternatives... You can add a route to the OpenID login action, and have an out-of-the box OpenID login form: Simply enter your OpenID URL, click login. The MVC Membership Starter Kit will handle the rest for you!
-
To all BlogEngine.NET users... Go patch!
This morning, I read about a serious security issue in BlogEngine.NET. The security issue is in the JavaScript HTTP handler, which lets all files pass trough... In short: if you open http://your.blog.com/js.axd?path=app_data\users,xml, anyone can see your usernames/passwords! None of the other HttpHandlers are affected by this security hole. My recommendation: if you are using BlogEngine.NET: go patch! (and yes, I patched it /js.axd?path=app_data\users.xml)
-
ASP.Net MVC Membership Starter Kit
Yesterday, I read a cool blog post from Troy Goode about his new CodePlex project MvcMembership. I also noticed his call for help, so I decided to dedicate some of my evening hours to his project. Almost every (ASP.NET) website is using some form of authentication, in most cases based on ASP.NET membership. With this in mind, Troy started an ASP.NET MVC version of this. The current release version provides a sample application containing some membership functionality: After an evening of contributing code, there's additional functionality in the source control system:
-
Reuse Excel business logic with PHPExcel
In many companies, business logic resides in Excel. This business logic is sometimes created by business analysts and sometimes by business users who want to automate parts of their everyday job using Excel. This same Excel-based business logic is often copied into an application (i.e. a website) and is maintained on 2 places: if the Excel logic changes, the application should also be modified. Did you know you can use PHPExcel to take advantage of the Excel-based business logic without having to worry about duplicate business logic?
-
ASP.NET MVC Framework out on CodePlex
This morning, I was browsing the new projects page on CodePlex and noticed something nice! The ASP.NET MVC team already rumoured around making the ASP.NET MVC framework source code available on CodePlex, but here it is: the ASP.NET MVC project on CodePlex. The CodePlex project does not allow people to make their own contributions, but you can easily look under the hood or fix bugs for your production environment. How cool is that! Happy coding! Update 4:45 PM: Seems like I've stolen the thunder from Scott Guthrie :-) To be complete: the official announcement was made a little bit later than my unofficial announcement. You can read about it here.
-
ASP.NET MVC - Testing issues Q and A
When playing around with the ASP.NET MVC framework and automated tests using Rhino Mocks, you will probably find yourself close to throwing your computer trough the nearest window. Here are some common issues and answers: A: When testing a controller action which expects Request.Form to be a NameValueCollection, a NullReferenceException is thrown... This is due to the fact that Request.Form is null. Use Scott's helper classes for Rhino Mocks and add the following extension method: [code:c#] public static void SetupFormParameters(this HttpRequestBase request) { SetupResult.For(request.Form).Return(new NameValueCollection()); } [/code]
-
March 18 ASP.NET MVC links
Too busy this week to write large blog posts myself... Luckily other people do write interesting things on ASP.NET MVC! Happy coding!
-
Heroes happen here - Microsoft TechDays 2008 in Belgium
Just to inform you: together with a numer of colleagues from Dolmen, I'll be attending the Microsoft TechDays 2008 in Ghent, Belgium on 12 and 13 March 2008. Want to spot me, Joris, Jeroen, Danny, ... and meet in person? Search for one of the guys in a Dolmen shirt! Update 17/03/2008: Jeroen posted an overview of the inspiring sessions on his blog.
-
OpenXML + Silverlight 2.0 = cool!
Mix '08 announced some nice things, among them the release of Silverlight 2.0 (beta), ASP.NET MVC framework (CTP 2). This morning, I saw one very cool thing in my RSS reader: TextGlow. TextGlow is James Newton-King's newest exciting project which basically combines Silverlight 2.0 and OpenXML into a fancy web-based Word 2007 document viewer. Think about combining this with my own Word 2007 document preview handler...
-
PHPLinq version 0.2.0 released!
Last friday, I released PHPLinq version 0.2.0. LINQ, or Language Integrated Query, is a component inside the .NET framework which enables you to perform queries on a variety of data sources like arrays, XML, SQL server, ... These queries are defined using a syntax which is very similar to SQL.
-
Data Driven Testing in Visual Studio 2008 - Part 2
This is the second post in my series on Data Driven Testing in Visual Studio 2008. The first post focusses on Data Driven Testing in regular Unit Tests. This part will focus on the same in web testing. I assume you have read my previous post and saw the cool user interface I created. Let's first add some code to that, focussing on the TextBox_TextChanged event handler that is linked to TextBox1 and TextBox2. [code:c#] public partial class _Default : System.Web.UI.Page { // ... other code ...
-
Data Driven Testing in Visual Studio 2008 - Part 1
Last week, I blogged about code performance analysis in visual studio 2008. since that topic provoked lots of comments (thank you Bart for associating "hotpaths" with "hotpants"), thought about doing another post on code quality in .NET. This post will be the first of two on Data Driven Testing. This part will focus on Data Driven Testing in regular Unit Tests. The second part will focus on the same in web testing. We all know unit testing. These small tests are always based on some values, which are passed throug a routine you want to test and then validated with a known result. But what if you want to run that same test for a couple of times, wih different data and different expected values each time?
-
Code performance analysis in Visual Studio 2008
Visual Studio developer, did you know you have a great performance analysis (profiling) tool at your fingertips? In Visual Studio 2008 this profiling tool has been placed in a separate menu item to increase visibility and usage. Allow me to show what this tool can do for you in this walktrough. Before we can get started, we need a (simple) application with a “smell”. Create a new Windows application, drag a TextBox on the surface, and add the following code: [code:c#] private void Form1_Load(object sender, EventArgs e) { string s = ""; for (int i = 0; i < 1500; i++) { s = s + " test"; } textBox1.Text = s; } [/code]
-
Indexing Word 2007 (docx) files with Zend_Search_Lucene
You may have noticed Microsoft released their Search Server 2008 a few weeks ago. Search Server delivers search capabilities to your organization quickly and easily. The PHP world currently does not have a full-featured solution like Search Server, but there's a building block which could be used to create something similar: Zend Framework's PHP port of Lucene. There is also a .NET port of Lucene available.
-
Books I recently read...
A while ago, I was contacted by the people of Packt Publishing asking me to review two of their latest books, ASP.NET Data Presentation Controls Essentials (by Joydip Kanjilal) and LINQ Quickly (by N. Satheesh Kumar). Since both books stated something about LINQ on the back-cover, and me wanting to read more on that matter, I engaged into reviewing them. Being an ASP.NET developer, I'm not new to ASP.NET's data bound controls. Upon receiving the book, I immediately knew this was not going to be new stuff to me, a thought which proved right. Nevertheless, the book has a value!
-
ASP.NET Session State Partitioning using State Server Load Balancing
It seems like amount of posts on ASP.NET's Session State keeps growing. Here's the list: Yesterday's post on Session State Partitioning used a round-robin method for partitioning session state over different state server machines. The solution I presented actually works, but can still lead to performance bottlenecks. Let's say you have a web farm running multiple applications, all using the same pool of state server machines. When having multiple sessions in each application, the situation where one state server handles much more sessions than another state server could occur. For that reason, ASP.NET supports real load balancing of all session state servers.
-
ASP.NET Session State Partitioning
After my previous blog post on ASP.NET Session State, someone asked me if I knew anything about ASP.NET Session State Partitioning. Since this is a little known feature of ASP.NET, here's a little background and a short how-to.
-
LINQ for PHP (Language Integrated Query for PHP)
Perhaps you have already heard of C# 3.5's "LINQ" component. LINQ, or Language Integrated Query, is a component inside the .NET framework which enables you to perform queries on a variety of data sources like arrays, XML, SQL server, ... These queries are defined using a syntax which is very similar to SQL. There is a problem with LINQ though... If you start using this, you don't want to access data sources differently anymore. Since I'm also a PHP developer, I thought of creating a similar concept for PHP. So here's the result of a few days coding: PHPLinq - LINQ for PHP - Language Integrated Query Let's say we have an array of strings and want to select only the strings whose length is < 5. The PHPLinq way of achieving this would be the following: [code:c#]
-
Preview Word files (docx) in HTML using ASP.NET, OpenXML and LINQ to XML
Since an image (or even an example) tells more than any text will ever do, here's what I've created in the past few evening hours: Live examples: Want the source code? Download it here: WordVisualizer.zip (357.01 kb) If you want to know how I did this, let me first tell you why I created this. After searching Google for something similar, I found a Sharepoint blogger who did the same using a Sharepoint XSL transformation document called DocX2Html.xsl. Great, but this document can not be distributed without a Sharepoint license. The only option for me was to do something similar myself.
-
ASP.NET MVC framework - Security
Some posts ago, I started playing with the ASP.NET MVC framework. In an example I'm creating, I'm trying to add Forms-based security. "Classic" ASP.NET offers a nice and easy way to set security on different pages in a web application, trough Web.config. In the example I'm building, I wanted to allow access to "/Entry/Delete/" only to users with the role "Administrator". So I gave the following snip a try: [code:c#] <location path="/Entry/Delete"> <system.web> <authorization> <allow roles="Administrators"/> <deny users="*"/> </authorization> </system.web> </location> [/code]
-
ASP.NET DataPager not paging after first PostBack?
A few posts ago, I mentioned that I am currently giving a classroom training on ASP.NET. People attending are currently working on a project I gave them, and today one of them came up to me with a strange problem... Here's the situation: in VS 2008, a web page was created containing 2 controls: a DataList and a DataPager. This DataPager serves as the paging control for the DataList. Databinding is done in the codebehind: [code:c#] protected void Page_Load(object sender, EventArgs e) { ListView1.DataSource = NorthwindDataSource; ListView1.DataBind(); } [/code]
-
Thank you, ISP!
Living in Belgium sometimes feels like living in the desert. Over the past few years, my ISP has always offered the same: a cable modem subscription with 10Mbit downstream speed, and 256Kbit upstream speed. Great! Except for that data transfer limit of 12 GB per month and the ridiculous price of 42 EUR (that is 61 US$). And no, there are few better alternatives in this center of Europe...
-
ASP.NET MVC Framework - Basic sample application
You might have noticed that I'm quite enhousiast about the new ASP.NET MVC framework. Basically, this new ASP.NET MVC framework is an alternative to standard ASP.NET webforms, with some advantages: For more information and a step-by-step tutorial, check Scott Guthrie's blog: For an article I'm working on, I am writing a sample application using this framework. This sample application is a very basic photo album website, listing some albums and photo's. Anyone who's interested in a sample MVC application (no data entry yet!) can download it.
-
ASP.NET 3.5 Extensions CTP preview released
Just over the weekend, Microsoft has released the ASP.NET 3.5 Extensions CTP. This download includes several additions to ASP.NET 3.5: I'll be doing some testing during the week, and keep you all informed.
-
LINQ to filesystem
The past few hours, I've been experimenting with LINQ. As a sample application, I'm trying to create a small photo album website, which shows me all images in a specific folder on my webserver. What does LINQ have to do with that? Everyone has used a loop over all files in a folder, and I decided to try LINQ for that matter. Here's how: [code:c#]
-
ASP.NET MVC framework preview to be released next week
Half the world has been focussing on the release of the new Visual Studio 2008 and .NET 3.5 last week. That is good, as .NET 3.5 offers lots of nice new features and improvements. In the blogosphere, I haven't read much about an extension I've been waiting for anxiously: the new ASP.NET MVC framework. Luckily, Scott Guthrie posted some examples on it, and I can't wait for a preview to be released next week. I'll keep you informed!
-
ASP.NET load balancing and ASP.NET state server (aspnet_state)
At one of our clients, we used to have only one server for ASP.NET applications (including web services). Since this machine is actually business-critical and load is constantly growing, the need for a second machine is higher than ever. This morning I was asked to set up a simple demo of a load-balanced ASP.NET environment. I already did this in PHP a couple of times, but in ASP.NET, this question was totally new to me. Things should not be very different, I thought. And this thought proved right! A bit later, we had a load balancer in front of 2 web server machines. We got everything configured, fired up our webbrowser and saw a different page on each refresh (stating the server's hostname). Load balancing mission succeeded!
-
PHP and OpenXML - New API project
It's been a while since I posted something related to PHP and OpenXML, but I fixed that glitch in this blog post. Browsing CodePlex, I found a new PHP OpenXML project named OpenXML API. From what I can see, this project is just in the "Hello world" stage of creating Word documents in PHP, but not so long ago my PHPExcel project was in that stage too... While I am talking about PHPExcel... Since today, the Subversion repository I host myself is synchronized 2 times a week with CodePlex's Team Foundation Server. If you want the latest source snapshot, please check PHPExcel's source code tab on CodePlex.
-
Advanced ASP.NET caching events
Currently, I'm giving an ASP.NET classroom training at our company, which actually is quite good for me: I needed to refresh all ASP.NET concepts, as those all fade away slowly when you don't use them for a while... Now, one of those refreshed concepts is ASP.NET's caching. ASP.NET offers a flexible built-in caching mechanism, providing you with a global "Cache" object in which you can get and put data which needs to be cached for a while. One of the cool things about ASP.NET caching is that it actually listens to what you want: if you need the cache to expire after 10 minutes, it does so. Also, when memory is needed for other actions on the webserver, ASP.NET will gently clean the cache depeding on cache item priorities.
-
OpenXML in Healthcare in PHP
Here's a cool present just before the weekend... 2 days ago, Wouter posted on his blog about an article he co-operated on for MSDN: OpenXML in Healthcare. Being both a Microsoft and PHP fan (yes, you can curse me, I don't care), I thought of porting (part of) the sample code from his article into PHP. Except for the document signing, as I did not have many time to write this sample code... The scenario for the article is quite simple: Contoso provides a central medical records database. Whenever a physician has to register a new patient, he downloads a Word 2007 document from the Contoso server, fills it out, and uploads it back. Contoso then strips out the necessary data and saves it back in their systems.
-
Generic arrays in PHP
Assuming everyone knows what generics are, let's get down to business right away. PHP does not support generics or something similar, though it could be very useful in PHP development. Luckily, using some standard OO-practises, a semi-generic array can easily be created, even in multiple ways! Here's the road to PHP generics. One of the roads to PHP generics is some simple inheritance and type hinting. Let's have a look at PHP's ArrayObject. This class has 2 interesting methods, namely offsetSet() and append(). This would mean I can simply create a new class which inherits from ArrayObject, and uses type hinting to restrict some additions: [code:c#] // Example classclass Example { public $SomeProperty;}
-
Inheritance is evil!
Read this on Bernie's blog: "All of the pain caused by inheritance can be traced back to the fact that inheritance forces 'is-a' rather than 'has-a' relationships. If class R2Unit extends Droid, then a R2Unit is-a Droid. If class Jedi contains an instance variable of type Lightsabre, then a Jedi has-a Lightsabre. The difference between is-a and has-a relationships is well known and a fundamental part of OOAD, but what is less well known is that almost every is-a relationship would be better off re-articulated as a has-a relationship." I suggest you read the full story, as it's very interesting! Bottom line is that you should be careful using OO inheritance, and use the Strategy pattern instead.
-
Enabling HTTP proxy for .NET webservice client
Have you ever written code that makes external (Soap) webservice calls? Tried that same code on your company network? Most of the time, this does not work very well due to a proxy server sitting in between, requiring authentication etc. You can start tweaking your Web.config file to set this proxy the right way, or you can override the generated web service class and include the following code snippet: [code:c#] using System; using System.Net; public class SomethingProxyEnabledService : com.example.service.something { protected override System.Net.WebRequest GetWebRequest(Uri uri) { WebRequest request = base.GetWebRequest(uri); request.Proxy = WebRequest.DefaultWebProxy; request.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
-
Remove unnecessary HTTP modules from the ASP.NET pipeline
Trying to speed up some things in a demo ASP.NET application for a customer, I found a really simple and effective way to remove some HTTP modules from the ASP.NET pipeline. When you are not using WindowsAuthentication or PassportAuthentication or ..., you can easily disable those modules. This decreases ASP.NET bootstrapping time as there are fewer object creations to do every page load... Now, how to do this? Very easy! Fire up your Visual Studio, and open Web.config. In the HttpModules section, add some "remove" elements, one for every module you whish to disable. If HttpModules section is not present, you can add it yourself. [code:xml]
-
Creating Office2007 documents in C#
-
Automatically generate SandCastle documentation using CruiseControl.NET or VSTS Team Build
Earlier this week, I was playing around with SandCastle, and found that the SandCastle Help File Builder (SHFB) was a great tool to quickly create SandCastle documentation. No more XML writing, just a few clicks and documentation is compiled into a HTML Help file or as a MSDN-style website. Next to the GUI being quite handy, there's also a command-line tool in the download of SHFB... Now wouldn't it be nice if you could just create a configuration file using SHFB, and automatically compile documentation on your build server every weekend? Here's a short how-to, for both CruiseControl.NET (ccnet) and VSTS Team Build! First of all, download and install the right tools on your build machine: This should not be difficult, right?
-
PackageExplorer, not only great for OpenXML...
-
Microsoft Tafiti just released
I'm sure you have already heared of SilverLight before, right? If not: it's Microsoft's answer to Adobe Flash, providing the same features + XAML-like markup + easier databinding + ... Now you're up to pubDatetime: the Redmond people have just released a new site, Microsoft Tafiti, which is basically Live Search combined with a rich SilverLight interface. Tafiti means "do research" in Swahili. Don't think I'm a native Swahili speaker though, I found this here 8-) The screenshot I made was first rendered in FireFox. No need to worry your SilverLight application not going to work on other systems than Windows + IE! If this is the way the web is evolving, I like it! Slick graphics, but not the "feeling" you are working in a browser plugin.
-
TFS Team Build and ASP.NET websites
Here's one I'd really like to share with everyone trying to build ASP.NET websites using TFS Build. First of all, a little story about the project setup... A VS2005 solution was created a few weeks ago. This solution included some projects, namely ASP.NET website, Domain Layer class library, Business Layer class library and DAL class library. The ASP.NET website uses project references to the class libraries, enabling automatic updates of all references on build. So far, so good. As a test case, this project was added to a new TFS project, and created a build for. That specific build kept failing forever, ignoring all tips I found on various websites.
-
Open XML Developer workshop content
Over the last few months, Doug, Wouter, Brian and lots of other people delivered a series of OpenXML workshops around the globe. Those who were there, and those who weren't, can now download all content of these workshops from OpenXMLdeveloper.org. There are some interesting slideshows available for those of you who never heared about OpenXML before, as well as some nice code samples to get you started developing in C# or Java. As a side note: I also spotted a good article on OpenXML, explaining the Open Packaging Conventions with a self-created file format (based on OpenXML).
-
PHP zip:// and parse_url...
After having a few months of problems using PHP and fopen('zip://something.xlsx#xl/worksheets/sheet1.xml', 'r'), I finally found the reason of that exact line of code giving errors on some PC's... Assuming this uses a call to parse_url under the hood, I tried parsing this, resulting in the following URL parts: Array ( [scheme] => zip [host] => something.xlsx#xl [path] => /worksheets/sheet1.xml ) That's just not correct... Parsing should return the following: Conclusion: beware when using parse_url and the zip file wrapper!
-
My job?
Seems that, according to this Wikipedia entry, I work at Microsoft: To clarify this: I do not work at Microsoft, but at Dolmen, one of the top Belgian IT firms. I do work with Microsoft technology and tend to promote their technology too, but no job at Microsoft.(Thank you Wouter for showing me this)
-
NHibernate 1.2.0 - Unexpected row count: 0; expected: 1
Great... I've been working with NHibernate and MySQL for a while now, without having any strange problems. For a project I'm working on, I'm using SqlClient instead of MySQL now, and strangeness occurs. When I try to Flush() a NHibernate session, here's what is thrown: The problem seems to be a combination of things. First, there's my mapping file: [code:xml] <id name="Hash" column="hash_id" type="String"> <generator class="assigned"/> </id> [/code]
-
Enable sitemap security trimming in ASP.NET 2.0
Want to enable security trimming for your ASP.NET sitemap? Here's how... First of all, you need a new section in your web.config system.web element: [code:xml] <system.web> <!-- ... other system.web configuration stuff ... --> <siteMap defaultProvider="XmlSiteMapProvider" enabled="true"> <providers> <add name="XmlSiteMapProvider" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap" securityTrimmingEnabled="true" /> </providers> </siteMap> </system.web> [/code] Next, you should specify which pages are visible to who: [code:xml]
-
VSTS Project methodology
A quick linkdump of some VSTS project methodology templates: RUP - http://www.osellus.com/solutions/microsoft/rup-vsts_solutions.htmlScrum - http://www.scrumforteamsystem.comMacroscope - http://www.fujitsu.com/us/services/consulting/method/macroscope/index_p2.html
-
Team Foundation Server - Subversion bridge
-
PHPExcel 1.3.5 released
Just a quick note on the new PHPExcel 1.3.5 release. There are some cool new features included! One of the new features is rich text: one can now write coloured and styled text in a cell. Here's an example of how the feature demo result file looks: This is of course not all. Jakub had a couple of sleepless nights, but managed to port in the PEAR Spreadsheet classes. Meaningless? No! PHPExcel now supports Excel2007 and older versions, too. Want to write an Excel document for Excel200? No problem: [code:c#] $objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);$objWriter->save('excel2000file.xls'); [/code] There's even a cooler part related to this, and that is .xlsx to .xls conversion! Here's how: [code:c#]
-
ASP.NET URL rewrites using .htaccess-like syntax
Having a PHP background, I've been using .htaccess mod_rewrite in Apache for ages. ASP.NET allows rewriting too, but using a different syntax than mod_rewrite. Using the attached library, you can now use mod_rewrite syntax to perform rewrites on your ASP.NET application. Here's how... First of all, you need to download the attached library. Reference it from your web project, and register it as a module in Web.config, preferrably as the first one: [code:xml] <httpModules> <add name="UrlRewriter" type="MaartenBalliauw.UrlRewriter.Rewriter"/> <!-- Other modules can be put here... --> </httpModules> [/code] Second, create a file UrlRewriter.xml in the root of your web project, and add rewrite conditions in there: [code:xml]
-
Enlisting an ADO.NET command in an NHibernate transaction
For everyone who has read my article on NHibernate, here's a story for you... When building an application, everyone comes to a point where one needs to batch-update records in a database table, based on one or more criteria. Let's say, for example, there's a table "User" containing an activation date. And you want to remove all users that have activated in 1999. In a regular database environment, or when using ADO coding, one would write a DbCommand "DELETE FROM User WHERE activationdate < '2000-01-01'".
-
Commandline FTP folder download
A quick annoyed post... I just spent two hours searching the Internet for a means on how to recursively download a complete FTP folder, command-line, and in a simple way. Oh yeah, and preferably freeware. The solutions I found were not what I expected: a $50 software product providing a GUI (I said command-line! [:@]), a bloated scheduler thingy that does download in the background (I said simple! [8o|]), to batch-files relying on Windows built-in ftp.exe and a gigantic list of all files that need to be downloaded.
-
My blog has just moved...
Just finished painting, unpacked some boxes, and here we are: a new home! The people from Eurobesthosting.com (shameless commercial plug in my blog) provided me my own ASP.NET server, which is now serving this page/RSS feed to you! A new home also means new URL's... I did my best forwarding all old URL's to this new page, but I won't keep the forwarding for the next century... The only noteworthy thing for you as a RSS reader, is the RSS feed URL, which has changed to: /rss.aspx. If you placed a link to my blog on your website, please change that link to /.
-
Disclaimer
The information on this website represents my personal opinion. My opinion may differ with other people's opinion and my employer's opinion. This website is by no means related to other people nor my employer. Texts, lay-out, images, script and other items on this site are protected by copyright. Copies, adaptations, translations, versions, modifications of whole or of a part of this site, in any form or manner, are prohibited, unless preceding written authorisation has been granted by the owner of this site. Each violation can lead to civil rights or criminal prosecution. Deeplinking is allowed when mentioning the original source.
-
OpenXML news overview
A lot of news around OpenXML these days, so I decided to bundle some things into one big blog post. In .NET 3.0, there's the System.IO.Packaging API, which allows programmatic access to OpenXML packages (amongst them Office2007 files).Since this API is quite low-level, the Microsoft people introduced a new SDK built on top of System.IO.Packaging, which allows you to use strongly typed classes for document parts. Checkout a code sample on Wouter's blog and see for yourself: this SDK provides access to an OpenXML package in a much easier way than System.IO.Packaging. Download the SDK here.
-
A small TFS linkdump...
Some new TFS links I found: Team Development with Visual Studio Team Foundation Server Guidehttp://www.codeplex.com/TFSGuide Work Item Creatorhttp://www.codeplex.com/wicreator/
-
New PHPExcel release: 1.3.0
The new version of PHPExcel has just been released, bringing 1.3.0 to the public. New features include formula calculation, inserting and removing columns/rows, auto-sizing columns, freezing panes, ... One of the new features in PHPExcel is formula calculation. Just like Excel or any other spreadsheet application, PHPExcel now provides support for calculating certain cell values, using a formula. For example, the formula "=SUM(A1:A10)" evaluates to the sum of values in A1, A2, ..., A10. Have a look at this: if you write the following line of code in the invoice demo included with PHPExcel, it evaluates to the value "64": Another nice feature of PHPExcel's formula parser, is that it can automatically adjust a formula when inserting/removing rows/columns. Here's an example:
-
Excel Formula Parsing using PHP?
One of the new (planned) features of PHPExcel is to implement parsing and calculating Excel formulas. One thing every developer should do is not to try to reinvent the wheel. Therefore, a Google search learned me someone wrote a Excel expression parser in JavaScript, which parses an expression into a tree. Parsing Excel formulas (expressions) in JavaScript is done here. Someone ported this to C# too, and as of today, it is ported to PHP5 too 8-). The only thing left to do is building this into PHPExcel, and performing calculations using the parsed tree...
-
MCTS for .NET framework 2.0 Web applications
Just like my colleague Kristof did last friday, I passed the Microsoft.NET Framework 2.0 - Web-based Client Development (Exam 070-528) exam yesterday, resulting in a new certification title: I’m now offically a Microsoft Certified Technology Specialist for .NET framework 2.0 Web applications.
-
SendMailControl for ASP.NET
Have you ever used the ASP.NET PasswordRecovery control, or the CreateUserWizard? Probably, you used the mail capabilities of these controls too, and set up a MailDefinition to send an e-mail when the control did his job. Personally, I missed this functionality when wanting to send mails to users. Luckily, ASP.NET is very extensible. I decided to create my own control providing an easy and convenient way to sending templated e-mails. Just set the From, CC, Subject and Body properties in the designer, and use the Send() method from code. Not the cleanest implementation of catching SMTP errors, but it was sufficient for my use. If you need to catch SMTP errors, you still need to add that... Anyway, as a gift for anyone who needs it, please find my SendMailControl underneath: [code:c#]
-
Excel, OpenXML and PHP
Yay! My new article on Excel, OpenXML and PHP has just been released in php|architect! A copy-paste action from http://www.phparch.com/issue.php?mid=102: "A few months ago, Microsoft released Office 2007, a version of their office suite that generates open source documents. Here, Maarten Balliauw gives an overview of the history and the politics surrounding the release before moving on to introduce his PHPExcel project, an early adoption of Microsoft's OpenXML API that enables Excel 2007 spreadsheets to be generated with PHP."
-
ASP.NET 2.0 Event Validation
Event Validation is a new feature in ASP.NET 2.0 which provides an additional level of checks on postback actions. It verifies whether a postback from a control on client-side is really from that control and not from a malicious person trying to break your application. Even if you forget to add security checks of your own, ASP.NET provides this functionality, because this feature is enabled by default. Sometimes, it is safe to turn this of, but Microsoft tries to have developers turn this of when they know what they are doing. Unfortunately: I came across Event Validation… A user control on a master page convinced ASP.NET that a postback within that same user control was unsafe, resulting in the following error:
-
Team Foundation Server tools linkdump
Currently, I'm playing around with TFS (Team Foundation Server), and here's just a quick linkdump of some TFS tools, mainly on CodePlex. http://msdn2.microsoft.com/en-us/vstudio/aa718351.aspx#cipphttp://www.codeplex.com/TFSAdminhttp://www.codeplex.com/automationhttp://www.codeplex.com/TFSCodeReviewFlowhttp://www.codeplex.com/tfsconsolehttp://www.codeplex.com/TfsPowerPack
-
Workaround for PHP file_exists on ZIP file contents
Recently, I was writing some PHP code, to check if a specific file existed in a ZIP file. PHP has this special feature called "stream wrappers", which basically is a system which enables PHP to do I/O operations on streams. A stream can be a file, a socket, a SSH connection, ... Each of these streams has its own wrapper, which serves as an adapter between PHP and the underlying resource. This enables PHP to do, for example, a file_get_contents() on all sorts of streams. Assuming regular PHP file functions would be sufficient, I coded the following: [code:c#] if (file_exists('zip://some_file.zip#readme.txt')) { ... } [/code]
-
Scalable Apps with Asynchronous Programming in ASP.NET
A while ago, I posted about the DevDays, and some interesting sessions I took. One of these sessions was "Scalable Apps with Asynchronous Programming in ASP.NET", by Jeff Prosise. Searching the Internet, I found that Jeff also published an article on this subject on MSDN, which can be found on the following URL: http://msdn.microsoft.com/msdnmag/issues/07/03/WickedCode/default.aspx.
-
Developer & IT Pro days - Ghent - Day 2
Just got back from the second and last day at the DevDays. It's all more exhausting than I thought it would be. First of all: driving from Antwerp to Ghent and arrive there in time means to get up early. Second, a lot of information and understanding needs to be processed and absorbed. Today, I've attended a session on C#3.0 and what's next by Raj Pai. Interesting material, seems to me that C# will evolve into something more declarative and flexible than it already is.
-
Developer & IT Pro Days - Ghent - Day 1
Day one of the Belgium Developer & IT Pro days is finished. I've been attending some inspiring sessions. First of all, Jelle Druyts showed us a quick overview of the Guidance Automation Toolkit. Interesting, and usable in many situations as standard Visual Studio templates do not always fulfill all your needs. Afterwards, Jeff Prosise spoke on using background threads in ASP.NET web sites, and how this can speed things up (a lot!). Another session was given by Doug Mahugh on OpenXML. Funny to notice my Prague co-developer also attended his session earlier this week.
-
Apache and IIS on same host, port 80, Windows XP
Yesterday, I decided to install an Apache web server on my development machine, next to IIS. Unfortunately, both use port 80, and I did not want to set one of the 2 servers to another port. Luckily, I remembered that IIS can be configured to only listen on one IP, and Apache on another. Easy: 2 IP addresses for my PC, and another server on each one.
-
New screen, Samsung is great!
Yesterday, I bought myself a Samsung SyncMaster 940BW wide screen TFT. My old screen, a IIyama 17 inch monster weighing CRT, needed a replacement. Not because of it's age, but because I really started hating this huge block on my desk. The SyncMaster is a great screen. Not the newest, not the most feature-loaded, but it delivers a 1440 x 900 resolution (nice if you are used to 1024 x 768!) and DVI. Photo's, regular use, ... all is really sharp on screen. If you're looking for a cheap wide screen TFT, this one's great! Something off-topic: PHPExcel has already been downloaded more than 700 times! The first version once got 36 downloads...
-
PHPExcel 1.0.0 final
I'm quite proud to announce the 1.0.0 version of PHPExcel, a set of classes that allows you to wirte Excel2007 files from PHP. Since my last post on this, a lot of things happened, feature-wise and project-wise. Feature-wise, conditional formatting was added, and a first attempt to a Excel2007 file reader has been created. Project-wise, Jakub Vrana signed up as a developer. He's currently working on an improved version of the Excel2007 Reader. We are still looking for extra developers: if you know PHP 5, object-oriented programming, have knowledge of/interest in OpenXML or the Open Document Format (as we plan to include that too), please apply.
-
Five things you didn't know about me...
I was tagged by Joris and Kristof, so I guess it's about time I give away some secrets about myself. Did you know that... I'm tagging:
-
PHP Excel classes on CodePlex
Just for the record: my PHP Excel classes have been released on CodePlex under a GPL license, and will be further released over there. The full URL: www.codeplex.com/PHPExcel.
-
Back from winter vacation!
No posts last week: I was on a ski vacation to Pitztal, Austria. Found a cheap (and good!) hotel over there, Pension Haid, which offered me breakfast and dinner for 36 EUR per night. I've been skiing on Rifflsee and the Pitztaler Gletscher, which offers great slopes (and also good weather conditions last week). Après-ski was offered by Siglu, which offered great Kaiser Pilsner! Back to reality (and work) now, problem with all vacations is: they are too short!
-
MyGeneration template for Zend_Db_Table
In my article on NHibernate, I mentioned MyGeneration, a tool which creates database classes / ORM classes from your database tables. Since MyGeneration uses templates to generate classes, and PHP is underrepresented, I decided to create a PHP Zend_Db_Table template, which creates the necessary Zend_Db_Table overloads for every table in your application built using the Zend Framework. Downloads and updates can be found on the MyGeneration template library: http://www.mygenerationsoftware.com/TemplateLibrary/Template/?id=be41c1ec-07e2-489c-ab6e-13f42f07adda
-
PHP for Microsoft AJAX Library
Something really interesting has just been released on CodePlex: PHP for Microsoft AJAX Library. The code you have to use in your scripts is clean and easy, providing a full-featured PHP backend to the Microsoft AJAX Library. The Microsoft AJAX Library is a pure-JavaScript library that's used by ASP.NET AJAX but is also available as a separate download. Because it's pure JavaScript, it's not tied to ASP.NET on the backend. PHP for MS AJAX is code to help you make use of the Microsoft AJAX Library from PHP applications. This PHP script simply exposes PHP classes as AJAX-enabled web services, just like ASP.NET applications would do.
-
PHP code performance tweaks
Thanks to Sam Cooper's testing, some scalability issues came up in my SpreadSheet classes. Seems PHP has some odd internal quirks, which cause performance loss that can be severe on large amounts of data. These strange things are probably caused by PHP because it uses multiple C functions in order to perform something a single C function can handle. Here's an example I discovered in my own code: When you have a large array, say $aNames, in_array('Maarten', $aNames) is really slow."Flipping" the array, making keys values, and values keys, and then using isset() seems to be roughly 3 times faster!So, when you need to check if an element is contained by an array, use the following code:$aFlipped = array_flip($aNames);if (isset($aFlipped['Maarten'])) { ... }
-
Excel2007 in PHP - Project status
After a month of development, I think it's time for a status update on my PHP Excel2007 classes. 16 december 2007, I started working on these classes as a test to check how hard it could be to create Excel2007 files using PHP5. The story about Excel2007 and PHP, got picked up by a few websites, and it seems my set of classes has been downloaded quite a number of times. This made me continue developing the basic "Hello World" example, to a set of classes which can produce Excel files like this one: Turns out my test-case is growing into something bigger. I'll keep adding some features, and keep you informed. The latest version can be found on CodePlex.
-
DataBindable Business Objects in .NET
Checkout Emmanuel Nuyttens' article on DataBindable Business Objects. It's an interesting article, focussing on the other side of data binding that I wrote an article on myself for .NET magazine.
-
Article in .NET magazine
The new .NET magazine Belgium/Netherlands has been distributed to all subscribers. For the latest edition, #15, I've written an article on the basic principles and usage of NHibernate, an ORM-mapper for the .NET platform. It's written in Dutch, so I must disappoint my English blog readers... A PDF version and example code can be downloaded on the .NET magazine #15 homepage. Comments can be posted on this blog post.
-
Office 2007 SpreadsheetML classes in PHP
In my evening hours, I've been working on a set of PHP classes to create Offixe 2007 SpreasheetML documents (.xlsx files). I finished my first goals (some basic XLSX writing), and I want to share this set of classes to the community. Currently, the following features are supported: Each cell supports the following data formats: string, number, formula, boolean. Visual formatting is not implemented, but I'll get to that later. An example of what can be achieved, can be found in this example XLSX file. A download of my class set can be found here. Class documentation is included.Please note that I am releasing this under GPL license.
-
Zend Framework custom route
Today, I was once again testing the Zed Framework. One of the things I was trying to do, is creating URL's in different languages. What I did was creating a controller 'user', with the action 'edit' (i.e. www.example.com/user/edit). Now, I want this to be available in Dutch too (i.e. www.example.com/gebruiker/bewerken). The trick is to add custom routes, which map back to the real controller and action. In my case, adding the following in my index.php did the job: Only bad thing is that you should add this for all your actions, otherwise not all routes succeed.Another important note is that routes are matched in reverse order. Make sure your most generic routes are defined first, and more specific routes last.
-
Bart Online
One of my former classmates, Bart Dekeersmaeker, has just created his own blog. He will be posting news from Chennai, India, where he currently resides for work. He is outsourced to KBC, and they asked him to go to India. Good luck on your mission, Bart!
-
Microsoft and Zend collaborate on PHP for Windows
A nice press release today at Microsoft: Microsoft and Zend Technologies Announce Technical Collaboration to Improve Interoperability of PHP on the Windows Server Platform. Both companies admit that PHP is often developed on Windows systems, but the final server environment is mostly *nix. With this collaboration, Microsoft and Zend will try to change that. The specific points of action in this collaboration: I think this is nice news! Looking forward to results of this collaboration...
-
Munin PHP based mod_security
Today, I discovered a nice PHP thing: Munin. This is a PHP version of Apache mod_security, allowing it to be run on IIS too. Munin performs rule based checks on HTTP headers, get and post data, ... The standard rule set disallows some things like path traversal and possible fopen() attacks. In addition to these rulesets, one should add some more for filtering out SQL injection attacks, cross-site script loading, ... These things should already be covered in your code, but an extra filter at the front door is always nice. You also get a nice control panel in which you can check rules that have matched and thus might indicate possible misuse of your website. You can also manage rules in this front-end.
-
PHP WSDL generator
Everyone who has ever created a webservice in PHP, using the PHP5 native functions, NuSOAP, PEAR, ..., certainly has cursed a lot while creating WSDL files for those services. Today, I found a nice helper class, Webservice Helper, which does a lot of tricks for you. Webservice helper creates the WSDL file for your service, and for related classes. Also, a basic authentication system is included. One necessary thing in your code is PHPdoc-style documentation. Webservice helper travels that documentation and uses reflection to generate class mappings. But normally, one should always document code.
-
Use Zend Framework on IIS
A while ago, I was experimenting with the Zend Framework. At first, I tried running a small sample on top of IIS, but unfortunately, that did not work... On Apache, it worked like a charm. Very nice, but what do you do when your site runs on an IIS machine? I started experimenting. First of all, I found out that Zend Framework also accepts URL's like http://localhost/index.php/controller/action/ as well as http://localhost/controller/action/. The first one is really handy! The only thing you have to do is to feed index.php the right query string and you're up and running. Changing all your URL's from /x/y to index.php/x/y should do the trick. But this does not look pretty in my browser. I don't want the index.php in between!
-
CruiseControl.NET configurator
For those looking for a CruiseControl.NET configuration tool: I just stumbled on this one at CodePlex
-
PHP on IIS7 (RC1), but unsafe!
Earlier this week, BillS has posted some information on how to run PHP on the upcoming IIS 7. To be honest, it's quite similar to installing it onto IIS 6 but with a few steps less. But I have a warning to add... PHP is added as an ISAPI extension, which binds to the multi-threaded IIS worker process. Unfortunately, not all PHP extensions are thread-safe... Registering the PHP as a CGI is better, but decreases performance. Use FastCGI! This technique can also be used on some Apache installations, but I still prefer IIS to do the job because it can run both PHP and ASP.NET. FastCGI recycles PHP processes and even persistent database connections! (mysql_pconnect etc.) Optionally, you can follow these steps for other extensions if you want PHP to execute on for example .php3 files.
-
Back from vacation!
I’m back from vacation! I went to Salou, Spain. Not to party or to find a new girlfriend every evening (I have one for almost 4 years now), but just for the sun and some vacation feeling after a year of work. The photo on the left was taken on the beach between Salou and Cambrils. Back to work now, be it a little more tanned than a week ago
-
Microsoft AJAX Library and ASP.NET AJAX Extensions
Scott Guthrie, one of the Microsoft "Atlas" guys, announced the "Atlas" 1.0 Naming and Roadmap stating that: Another nice thing in Scott's post is the following: Things will get even better next year with Visual Studio “Orcas” where we are adding rich JavaScript intellisense, debugging and WYSIWYG designer support for the ASP.NET AJAX Extensions within Visual Studio and many other great features to take advantage of.
-
Seems like Google updated satellite maps
Sometimes, I take a look at Google maps to check if Belgium is finally mapped and photographed with more detail. When I checked today, I found out some regions near Antwerp and Brussels now are much more detailed. On my house picture, before really blurry, I can see the snapshots were taken during the summer: our new umbrella (is parasol correct English?) is open on the terrace. Looking for evidence of this update, I found an unofficial article on Tweakers.net stating that also the Netherlands have had a major imagery update. The article also states that some military bases are totally blurred out. Seems like I work on a military base? (which is not)
-
Buying books...
Seems like Proxis is offering a 10% discount when you order 2 computer books before the end of september! And I saw 2 nice PHP books… “Php5 Objects, Patterns, Practice” and “Php 5 Power Programming”. Anyone knows if I should give them a try? If you have other great titles on topics like PHP, C# and ASP.NET, please comment this post with title and ISBN number
-
Simple SAX parser for PHP
Yesterday, I was working on PRAjax. The UpdatePanel did not work completely as I wanted it to work: in the background, the whole page was still fetched and updated. A cleaner way would be to just fetch updated content and not the whole page. In my search for a PHP HTML parsing class, I found a lot of libraries, but all with disadvantages: one was too big in file size, another only parsed XHTML, ... Luckily, I stumbled on SAX parser! So if you ever want to parse HTML and read out specific tags and attributes, try this one.
-
Internet Explorer 7 RC1 available
When I opened my RSS reader this morning, I saw good news: Internet Explorer 7 RC1 has just been released! You can download it here or install it as stand-alone version (unofficial!). Many people will like the new UI features, like tabbed browsing, tab preview, easier interface, less toolbars, ... The features I like are the better CSS support and other tech enhancements. For example, this blog uses several IE-specific CSS hacks to get everything (almost) in place. Now let's hope IE7 does not get confused by those hacks. But I fear too: my PRAjax project relies on several browser specific objects, like XMLHttpRequest. I had to make some adaptations for IE7 beta 1, some adaptations for IE7 beta 2, so now I hope everything keeps working like a charm on IE7 RC1...
-
Google Analytics open for everyone!
Almost a year ago, Google acquired Urchin, a company specialised in providing web site statistics. They renamed Urchin's project to Google Analytics and started a beta for some. Today, it seems Google has opened Analytics for everyone. Get it while it's hot, they really provide in-depth statistics about what's happening on your website. I tried it out for a few days on my website Holidayhome.be, and experienced all possibilities. Currently, I use Statcounter there, which also provides detailed statistics, but only for the last 100 visits.
-
JavaScript URI parameter encoding
When creating a HTTP request in JavaScript, I always used encode() and decode() to pass data between client and server. I also used this approach in PRAjax, my open-source Ajax helper library for PHP. A developer working with PRAjax on his site reported to me last week that Swedish characters like å, ä, ö, ... were not passed corerctly to and from the server. My first reaction was: add a UTF-8 header on the server side, and it should work. Characters from other character sets are always displayed correctly when doing that. Except when using JavaScript, it seemed when I tried entering Swedish...
-
Goggles, a flight sim on Google Maps
You have probably already seen over a hundred uses for Google Maps. Today, I received a link of a new use: Goggles. Goggles allows you to fly a plane over a city, to climb and descent, to shoot at the scenery (I tried this over Amsterdam but didn't hear anything on the news. It's safe!). You even can crash. A while ago I thought on developing a game on Google Maps too. No action-game, no flight simulator, but more a strategic game. Imagine a sort of Risk or Transport Tycoon on satellite imagery. Unfortunately, I didn't find the time to even think about a nice game concept. Maybe once!
-
Kurkdroog
I regularly drink a glass of beer (I prefer the Belgian Trappists) or a glass of wine. While surfing, I stumbled upon a handy link for all Belgian people who love to drink wine too: Kurkdroog Kurkdroog is a website that acts as a hitlist of wines. You can select a price class, a supermarket, a country and a wine type (red, white, rosé, ...), and the site returns a list of wines matching your criteria, with the price and a short review next to it. Perfect stuff!
-
Age of Pirates
A few weeks ago, I discovered a nice online multi-player game: Age of Pirates. AoP is in a certain way similar to one of my favourite games Age of Empires, available as an offline game. In AoP, you have an island on which you have to gather resources in order to improve your economy and military activity. When you have a certain grade, it's possible to create ships and to colonize other islands. There, you can crop cacao, hemp and other goods which you can trade with other players for money. Also, you can attack other player's islands and plunder their resources. And if your fleet is large enough, you can even takeover the island and incorporate it in your empire.
-
Phalanger
Today, I noticed that Phalanger has released a new beta a few days ago (well OK, half a month ago [*-)]). Phalanger is an open-source project, aiming to provide tools to integrate PHP development in Visual Studio on one side, and aiming to provide a CLR compiler for PHP on the other side. In short, this means that Phalanger compiles PHP code to MSIL (Microsoft Intermediate Language) and thus can run PHP on the .NET Framework. I guess that would mean a huge PHP speed improvement! Also, Phalanger provides access to native .NET namespaces, which can be used within PHP scripts. Nice! Imagine ASP.NET webcontrols and PHP code... For me, it sounds like a nice dream [Y]. I guess I'll have to check that all out. It's placed on my to-do list, which seems to always get filled more and more...
-
Have you alreday tried PRAjax?
Some people who know me, have already experimented with my home-brew PHP Ajax framework, PRAjax. PRAjax is short for PHP Reflected Ajax, and provides the glue between server-side PHP and client-side Javascript. You should really try it out in your project! My blog uses PRAjax too. Try navigating to the homepage and clicking a [more...] link. The article body is then fetched behind the scenes and updated on your browser view. A small example... One can write a method in PHP, and make it callable by the client using JavaScript. For example, you have the following PHP code: On the client-side, you can now call this method asynchronously (using, for example, a link with an onclick method "Hello('Maarten');", and get the result in a callback function:
-
A new computer...
2 weeks ago, my previous computer died. A black screen with a white blinking cursor was the only thing it still did. Curious about that, I opened the case and saw... leaking capacitors. According to Google searches about that, something went wrong with industrial espionage a few years ago. Nice, I had spied capacitors and a dead computer. Even more typical was the fact that my warranty had expired 2 years ago. And that all in a week I planned to develop on my blog and some other private projects. The best cure to quicly get to work: a new computer.
-
My first blog post!
Starting today, I will try to regularly post some information about myself, my job, my life, my opinions. Some of my colleagues at work, mainly Joris, told me I should start a blog too. He has his blog hosted at Blogspot, but I really wanted to host it myself. After trying some PHP software (Wordpress, NucleusCMS), I decided to write my own software, based on my PHP Framework I also use at Holidayhome.be and Eurobesthosting.com. You will see that I have not (yet) implemented all "standard" blog features like rating, trackbacks, pings, ... Bad news: it'll maybe become implemented, maybe not. Luckily for all those blog fanatics out there, comments can be made, and I also have an RSS feed based on using tags. That way, you can build your own custom-made Maarten feed.