Category Archives: .Net

How to set up a Parameterized Unit Test

In my previous post we saw how to set up unit testing using Visual Studio. The code we want to test is a (simple) function to calculate the greatest common divisor, and we wrote our first test. The test we … Continue reading →

Posted in .Net, Codeproject, Debugging, Development, Methodology, Testing | Tagged , , , , | Leave a comment

Setting up unit testing

Introduction In the previous posts I talked about unit testing. I gave some background, and I explained the flow of Test-driven Development (TDD). So now is the time to set things up. In this article I will use the calculation … Continue reading →

Posted in .Net, Codeproject, Development, Methodology, Testing | Tagged | 4 Comments

Could not load file or assembly ‘System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’

When creating a new MVC5 application using VS2013 I got the following error: Could not load file or assembly ‘System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception … Continue reading →

Posted in .Net, Development, MVC, MVC5, Web API | 2 Comments

“Object reference not set to an instance of an object” when building my cloud project

In my Azure project I have a worker role and a wcf role. When compiling it failed (with no obvious reason) with this message in the output window: Error: Object reference not set to an instance of an object There … Continue reading →

Posted in .Net, Azure, Development | Leave a comment

XslLoadException: The type or namespace name ‘SecurityRulesAttribute’ does not exist in the namespace ‘System.Security’ (are you missing an assembly reference?)

While porting a project from .Net 3.5 to .Net 4 we got this weird error. The error occurs when loading an XSLT in memory. Here is the failing piece of code (simplified): private static XslCompiledTransform ReadXslt(string fname) { XslCompiledTransform xsl … Continue reading →

Posted in .Net, Development | Tagged , , | 1 Comment

Using a TreeView in WPF

Using a tree view in Windows Forms is straightforward, but in WPF the control has undergone a lot of modifications. In this blog I’ll describe how to do some tasks that seem to be easy enough, and describe some caveats. … Continue reading →

Posted in .Net, Development | Tagged , , | Leave a comment

Rediscovered the Debug attributes

There are 2 attributes that can easily be applied to your classes / methods to modify the behavior at debugging time. The attributes don’t change the runtime behavior of your code. [DebuggerDisplay] This attribute defines how you’ll see a type … Continue reading →

Posted in .Net, Debugging, Development | Tagged , | Leave a comment

Could not load file or assembly ‘System.EnterpriseServices.Wrapper.dll’

I had this error when running a .Net 3.5 app that is using a DB2 connector on a Win XP SP3 machine. The application has always worked until today and is in no way using the referenced assembly (just executing … Continue reading →

Posted in .Net, Assembly | Tagged , , , | 2 Comments

FuslogVw–debugging assembly loading

We’ve all had it before: referencing some libraries, recompiling the project and then the variation on the DLL hell: the assembly hell. Suddenly one of your assemblies (or on of its dependent assemblies) doesn’t load anymore. Debugging this can be … Continue reading →

Posted in .Net, Assembly, Development | Tagged | Leave a comment