Monday, March 24, 2014

Sunday, February 23, 2014

Problem Running application in IISExpress in Visual Studio over SSL

I Currently set up an Azure VM to use as a development machine, I used MSDN's Default Visual Studio 2013 Image.

When I try to run my web application locally Internet Explorer gives me a "This page can't be displayed" error... firefox gives me "The connection was reset".
When browsing to the default non https port everything works as expected though...

so the solution:

1. uninstall iisexpress 8.0 (Control Panel > Uninstall a program)
2. mmc.exe, Add/Remove snapp-in, Certificates, select  Local Computer (Click Next), Finish
   here look under Personal, Certificates and delete the certificate Friendly Name = "IIS Express Development Certificate"
3. Reinstall IIS Express 8.0
4. following actions outlined in step 2. find the new "IIS Express Development Certificate", double click and goto details, find the thumbprint and copy the hash: ‎38 b3 05 a5 d2 1c ba 8b cb 45 fa 03 06 9a d4 b6 94 00 97 f9
5. remove the spaces from the hash: ‎38b305a5d21cba8bcb45fa03069ad4b6940097f9
open an elevated command prompt.
netsh http show sslcert > sslcert.txt

look for the entry matching your port. In my case it was this:
    IP:port                      :
    Certificate Hash             : f5584bb1e88d4240d962bec7120e5a90302ff3b9
    Application ID               : {214124cd-d05b-4309-9af9-9caa44b2b74a}
    Certificate Store Name       : MY
    Verify Client Certificate Revocation : Enabled
    Verify Revocation Using Cached Client Certificate Only : Disabled
    Usage Check                  : Enabled
    Revocation Freshness Time    : 0
    URL Retrieval Timeout        : 0
    Ctl Identifier               : (null)
    Ctl Store Name               : (null)
    DS Mapper Usage              : Disabled
    Negotiate Client Certificate : Disabled

netsh http delete sslcert ipport=
netsh http add sslcert ipport= appid={214124cd-d05b-4309-9af9-9caa44b2b74a} certhash=38b305a5d21cba8bcb45fa03069ad4b6940097f9

Hanselman's blog

Wednesday, February 19, 2014

Bootstrap: 404 Not Found on .woff files

When using bootstrap I got the following message in my firefox console:

"NetworkError: 404 Not Found -"

Add the following lines to your web.config



Friday, September 06, 2013

Windows Identity Framework Signing out

When using claims based security and you implement the sign out functionality do not forget to delete the sessions cookie... otherwise when playing around with the back button you are able to sign in again... this is something you don't want...

Loading ....

Monday, June 17, 2013

MVC: Intellisense for custom HtmlHelpers or if you want to avoid @using to import namespaces

If you write custom HtmlHelpers its quite tedious to have to add @using on top of each page. To be able to use your newly written htmlhelpers

to avoid this just find the web.config in your views folder and locate the following section:
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization"/>
                <add namespace="System.Web.Routing" />
                <add namespace="SharpSolutions..MvcApplication.Helpers.BootStrap"/>
                <add namespace="SharpSolutions.MvcApplication.Helpers"/>

and add your custom namespace to it.

After you have done this reload your mvc project (or close Visual Studio and reopen it).

Tuesday, June 11, 2013

Windows Azure Logging not working Trace.TraceError throws: Not running in a hosted service or the Development Fabric.

I had the following line in my web.config:

    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
     <filter type="" />

After removing this: it created WAWSAppLogTable as expected.
More info can be found here:

for local debugging I left the line untouched... I created a new config transformation where I added:

    <add name="AzureDiagnostics" xdt:Locator="Match(name)" xdt:Transform="Remove" />

Which is quite logic since Azure websites is not hosted in the AppFabrik

Friday, June 07, 2013

Team Foundation 2012: Run xUnit unit tests

Currently I am using and writing my unit tests with xUnit. To enable this follow the steps outlined on MSDN.

You can find the binaries in the packages folder in your solution directory

Wednesday, December 19, 2012

Windows 8 RDP with blank password

If you want to enable Remote Desktop with a blank password on window 8, this is the same procedure as enabling rdp on windows 7 instructions can be found here

As a collegue suggested enabling this is a security risk.

Saturday, July 28, 2012

Migrating Legacy Applications

Legacy Systems

Legacy systems are systems that have grown over the years and became harder and harder to change and or are build on outdated technologies. Since business is changing rapidly these systems no longer can keep up the pace. Certainly in people that sell services products that are sold can be very complex, take for instance insurances.
Often these systems are the core of the systems, if these systems go down you the company looses money, in certain areas you can loose thousands of dollars per minute you are down.


Signs that tell you that your current system will become unstable can be:
  • Downtime
  • More and more bugs, regression
  • Implementing new features takes longer and longer
  • Solving bugs takes longer
  • Unable to scale up your system
  • Upstaffing of your operational team
More about these symptoms you can read about here.
Usually when you start experiencing the negatives effects of these systems your legacy system will need to be changed quite urgently.
These symptoms will result into an increased TCO. Keeping the system operational will become increasingly difficult since people that operate these systems become older, skills required will become very rare.



There are several different approaches that can be taken to modernize your legacy system.
  • Garbage in-garbage out: for certain languages there are tools that convert your source code from one language to another like vb6 to vb .net, vb .net to c#
  • Big Bang Migration: full migration of a system, you rewrite your whole application at once and one magic day you put everything at once in production.
  • Incremental Migration: You partition your system in smaller subsystems and you put your system in production increment per increment.


Migration by tool

This approach can work if for instance you need to upgrade your system from one version to another. The biggest risk here is that when you do this you will not solve the fact that your software is difficult to adapt. It's an illusion that a system will be easier to adapt in a new technology than it was in the older one. What can be an added value of new technology is better development tools helping you with better support for refactoring to bring your system in a condition that is more suited to change and easier to change.

Big Bang Migration

This approach where you rewrite application from scratch and migrate your data from the old system to the new system. The biggest risk here is that when your project fails the entire project fails, the outcome becomes more unpredictable the bigger the project gets. The risk in this undertaking are generally huge and need to be assessed carefully.
This approach can be successful in projects that are quite small, your data is of high quality, you know your data structures and don't have a lot of dependencies on other systems.
There also is no guarantee that the new system you build will not start to show the same symptoms as your old one. If you do not put in place good programming techniques and adhere very strict quality guidelines the chance is big that the new system will become hard to change quite quickly.
Another downside is that business will not stop the evolve either you will be faced with the fact that you will need to implement old functionalities and in the mean time keep track of new developments also.
The cost is very high since you need to be operating your legacy system and in the meanwhile develop a new one which requires input from the people that are operating your legacy system which will have low availability due to the fact the need to keep the business afloat.
This approach is often chosen but often fails or costs enormous amounts of money.

Incremental Migration

When performing an incremental migration. You will have to divide your legacy system into smaller functional components and migrate each one step by step. The partitioning needs to be done just-in-time, enough to keep you busy.
The huge upside of this approach is that its the risks are highly controllable and that if something goes wrong the feedback is rapid and the impact of the failure is limited and predictable.
Another big advantage is also that you will be forced to build your system in such a way that is easily extended and changed.
The downside of this is that the people that operate your legacy system need to be actively involved with the new developments since they have indispensable knowledge about how the old system and the business operates, since they are responsible for operating the old system their availability might be quite limited. Combined with a significant increase in cost having to keep two teams.
It need to be taken in mind also that when doing an incremental modernization that every step you take needs to able to be rolled back so in the beginning this will require a significant effort to easily and rapidly deploy and rollback your changes.

Sunday, July 08, 2012

Git and Visual Studio 2012

Some points to take into mind when using Git in combination with Visual Studio 2012, Resharper and NUGet.
Manually add following entries to your .gitignore file
  • packages/
  • TestResults/
## Visual Studio

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files

# Build results


# Visual Studio profiler

# ReSharper is a .NET coding add-in

# Installshield output folder

# DocProject is a documentation generator add-in

# Click-Once directory

# Others
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)

## Windows

# Windows image file caches

# Folder config file

## Python


# Packages

# Installer logs

# Unit test / coverage reports


#Mr Developer

# Mac crap