Showing posts with label dotnet. Show all posts
Showing posts with label dotnet. Show all posts

Tuesday, February 22, 2011

How to use NUnit in Visual Studio 2010

To run NUnit, you need to add the following to the NUnit.exe.config file:

Under C:\Program Files\NUnit 2.5.9\bin\net-2.0\nunit.exe.config (replace version with whatever you have installed) add the following:

 <startup>
   <!-- the below is WRONG! See here for why.
      <requiredruntime version="v4.0.30319">
    -->
   <supportedruntime version="v4.0">
 </startup>

Also add the following in the <runtime> block:

<loadfromremotesources enabled="true">

The reason is that in .NET v3.5 and below, remote assemblies were loaded partially trusted. Starting with .NET v4, unless you add this directive then you will get a runtime exception.

Once you have done this, add another dll project and add a reference to NUnit.Framework.

Monday, October 18, 2010

ICloneable: Microsoft's big mistake

So here's the deal: if you implement ICloneable in a public API, you are a making a big mistake. Why? Because there's no way of knowing if the Clone() function will do a deep or shallow copy.

As it turns out, even Microsoft know that they have made a mistake with this interface. Oopsy!