Skip to main content


Showing posts from July, 2011

ASP.NET MVC Telerik Extensions

After installing the ASP.NET MVC Telerik Extensions, we couldn’t get the custom htmlhelpers working when using the Razor syntax. Finally we discovered that the namespace was added to the root web.config <add namespace="Telerik.Web.Mvc.UI" /> were it should have been added in the ~/Views/Web.Config: <system.web.webPages.razor> <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <pages pageBaseType="System.Web.Mvc.WebViewPage"> <namespaces> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="Telerik.Web.Mvc.UI" /> </namespaces> </pages> </system.web.webPages.razor>

Windows Azure AppFabric July Release

This week Microsoft released several updates and enhancements to the Windows Azure AppFabric Management Portal and the Access Control service. An overview: Management Portal Localization: the Windows Azure Platform Management Portal now supports the following extra languages: Japanese, German, Traditional Chinese, Simplified Chinese, French, Italian, Spanish, Korean, Russian, and Brazilian Portuguese. Co-admin support:  Co-administrators have finally access to the AppFabric section of the portal. Context Menus:the Portal now supports right click menus in the “Hosted Services, Storage & CDN” pane. Performance Improvements: Users can expect to see significantly lower initial load times with the addition of a local temporary cache and the optimization of network bandwidth consumption. Enhanced Delete Deployment: Developers can now delete running deployments. In earlier versions, developers had to wait for a deployment to stop before it could be

Claims Based Authentication: SecurityTokenVisualizerControl

One useful control when developing Claims based web applications is the SecurityTokenVisualizerControl. The Security Token Visualizer control (STVC) is a simple ASP.NET server control which displays in a compact layout useful information about claims-based identity in a web site secured with Windows Identity Foundation. The STVC is intended to be a debugging aid, which helps you to inspect what identity info you are receiving from the STS without the need for attaching a debugger to your website. Furthermore, STVC spares you the repetitive task of writing code that retrieves and render claim values or other info about the incoming security token that are typically needed in the development & testing phases of your application life cycle. Only the source code is available but you can easily compile it yourself. Go check it out: . Note: If you execute the installer without Visual Studio 2008 installed,

Windows Azure Storage: One of the request inputs is out of range

Last week I ran into following error when trying to create a blob storage in Windows Azure: “One of the request inputs is out of range”   Let’s have a look at the code who causes this error. Do you see something special? var blobStorage = storageAccount.CreateCloudBlobClient(); var blobContainer= blobStorage .GetContainerReference(“My Blob Storage”); blobContainer.CreateIfNotExist(); I didn’t see something wrong.  But when I changed the reference name to “myblobstorage” suddenly everything worked fine. It seems that you cannot use any name you want for Windows Azure Storage containers. I discovered the following naming rules(maybe there are more): use only lower case letters digits are allowed anywhere name should not contain any spaces A more obvious error message would have been helpful.

Class Template is missing in Visual Studio

After playing around with Stylecop for a while, I decided to remove it from my system. So I just uninstalled it and everything seemed fine…until I tried to create a new class in Visual Studio. The class template was gone! I discovered that Stylecop replaces the default class template with it’s own one. However it doesn’t put the old one back in place after removing Stylecop. So how do you get this template back? I noticed inside the Visual Studio template folder(C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033) that the class template was still there but renamed. I changed it back to the original name and thought that the job was done. But I still had no class template available. It took me some time to figure it out but in the end, I solved it by executing the following extra actions: Close all Visual Studio instances. Open a Visual Studio Command prompt. Execute “ devenv /InstallVSTemplates ”. This command registers pr

Windows Azure Accelerator for Web Roles

Last week Microsoft announced the release of the Windows Azure Accelerator for Web Roles . This accelerator makes it quick and easy for you to deploy one or more websites across multiple Web Role instances using Web Deploy in less than 30 seconds. This solves on of the biggest issues when using Windows Azure as a hosting platform. No longer long coffee breaks before your application is deployed, but 30 seconds later you can run and test your site! Feature highlights: Deploy websites to Windows Azure in less than 30 seconds. Enable deployments to multiple Web Role instances using Web Deploy from both Visual Studio and WebMatrix. Saves Web Deploy packages & IIS configuration in Windows Azure storage to provide durability. A Visual Studio Project template that allows you to create your web deploy host. Full source and NuGet packages that you can use to build custom solutions. Documentation to help you get started. For additional information visit the foll

Good JavaScript Habits for C# Developers

A must see for every .NET (web) developer: “It seems that far too many people come to jQuery thinking that their previous knowledge with object-oriented languages like C# or Java will help them be successful at client-side scripting. In many cases, you can be successful with this approach, however, the more JavaScript you write you will inevitably find yourself uncovering strange bugs because you didn't take time to learn JavaScript properly. This session is targeted for developers that use jQuery, but haven’t invested adequate time to learn some of the foundational JavaScript concepts that differ from C#. If you would like to avoid some of these common mistakes when bringing your existing expertise to JavaScript, then please join me as I try to explain some of the differences.”

Microsoft - Domain Oriented N-Layered .NET 4.0 App Sample

Microsoft enters dangerous territory by trying to provide a sample of DDD (Domain Drive Design). It’s very hard to show the benefits of DDD in a simple sample, so I’m really curious how this will work out. What I noticed immediatelly they start with a long list of things they will NOT try to do: “This project/sample is willfully restricted to .NET implementation of most used patterns in N-Layered Domain Oriented Architectures based on simple scenarios easy to understand (Customers, Orders, Bank Transfers, etc.). This initiative is NOT trying to teach how to apply DDD. That shouldn't be Microsoft's goal and DDD is much more than Architecture & patterns implementation. This is an Educational example, not a real world system , it shows educational scenarios, easy to understand useful from a patterns implementation point of view , but not necessarily as a whole business application. The architecture is decoupled and relatively complex so it would allow to grow your

Windows Server 2008 R2: Assign permissions to ASP.NET v4.0 account

On our webservers (Windows Server 2008 R2 machines with IIS 7.5), our application pools run using the "ASP.NET v4.0" account instead of the NetworkService account. But we had some trouble assigning permissions to this ASP.NET v4.0 account. It does not appear as a local user on the machine. When we browse for local users, groups, and built-in accounts, it does not appear in the list. Luckily you can still add the user through the NTFS GUI by typing it in directly. The name is in the format of IIS APPPOOL{app pool name}. For example: IIS APPPOOL\ASP.NET v4.0.

Error when trying to download NuGet Package

At one of my customers we are creating our own internal NuGet server. This is very easy to setup thanks to the availability of the NuGet.Server package . Create a new empty ASP.NET website, add the NuGet.Server package and deploy the solution, that’s all! New packages should be added to the available package folder and are automatically discovered by NuGet.Server.  This all worked fine until we tried to download our first package. We got the following error back: “The remote server returned an error: (401) Unauthorized.” We solved the issue by giving everyone read rights on the package folder. Afterwards we were able to download the packages fine. Anyone with a different/better solution?

Be a ninja in the Cloud

Microsoft released version 2 of their Cloud Ninja Project . The Cloud Ninja is a Windows Azure multi-tenant sample application demonstrating metering and automated scaling concepts, as well as some common multi-tenant features such as automated provisioning and federated identity. They kept the code simple and easy to follow, making it easy for anyone looking through the application to follow the logic. Key Features Metering Automated Scaling Federated Identity Provisioning Contents Sample source code Design document Setup guide Sample walkthrough

The Visual Studio ALM rangers ship new ALM guidance

I noticed yesterday that the Visual Studio ALM rangers shipped some new guidance on ALM: First of all they released the Rangers Lab Management Guide on Codeplex.. Project Description This Visual Studio ALM Ranger project has the primary goal of delivering scenario based and hands-on guidance for the planning, setup, configuration and usage of Visual Studio Lab Management, backed by custom VM Template automation for reference environments. The following Epics summarize the scope of the guidance which is designed for professional deployment of Lab Management in production environments. Visualisation of the guidance using quick reference posters Advanced golden image management using the VM Factory for Lab Management Provide guidance on setting up Test environments with respect to pre-defined personas Provide Guidance to enable large and small teams to setup and configure both automated and manual tests Provide practical guidance for managing and maintaining

Exercise is the key to craftsmanship

How can you become better in what you are doing? The answer is simple; through exercise! This idea is practised a lot in software development through the usage of CodeKatas . But CodeKatas suffer from their size. They are very small but this small size limits the methods, techniques, technologies that can be applied. To improve your TDD skills doing CodeKatas might be enough. But what about other skills? Developing on a software in a team, designing larger pieces of software, iteratively releasing software… all this and more is kinda hard to train using the tiny CodeKata problems. Ralf Westphal introduces a new kind of exercise called Application Kata (or just AppKata). “AppKatas are larger programming problems. They require the development of “whole” applications, i.e. not just one class or method, but bunches of classes accessible through a user interface. Also AppKata problems always are split into iterations. To get the most out of them, just look at the requirements of on

NDC 2011: Session videos online

If you couldn’t attend NDC 2011, you can try to keep up with all the interesting sessions you’ve missed. They’ve just put all the videos online. (There goes my remaining free time…) Check them all out on the official website: .

Server hangs: DW20.exe

Last week the production server went down at one of my clients(woops…). The issue was that the IIS worker process, W3WP.exe was crashing when the users tried connecting to some websites(and webservices). In fact, it wasn’t the W3WP.exe itself who made the server hang, but DW20.exe. DW20.exe is Dr.Watson, the Windows Error Reporting tool and was trying to do something when the error was happening on the server. We’re still investigating the root cause of the issue, but disabling the Windows Error Reporting tool did the trick: Go to Control Panel. Click System. Go to the Advanced tab. Click Error Reporting. Click Disable error reporting.  

Could not execute Powershell script

Last week I had to run a maintenance script on a server. But it gave me the following error: File cleanup.ps1 cannot be loaded because the execution of scripts is disabled on this system. Turns out that by default the security setting on the server(the so-called Execution Policy) does not allows us to execute a script. By default, the Execution Policy is set to Restricted. This setting means that you may not run any PS1 script at all. You can choose between the following Execution Policy levels: Restricted This is the default configuration in PowerShell. This setting means that no script can run, regardless of its signature. The only thing that can be run in PowerShell with this setting are individual commands. AllSigned This setting does allow scripts to run in PowerShell. The script must have an associated digital signature from a trusted publisher. There will be a prompt before you run the scripts from trusted publishers. This exposes you to running si