Tuesday, June 09, 2009

nUnit reports no TestFixtures on a network share

nUnit just detects no tests, with no error message at all !!!
actually if your assembly in on a network share, you need to "trust" this share, with the caspol.exe command line.

Here is the one i've used:

CasPol.exe -m -ag 1.2 -url file://z:\trunk\* FullTrust


I've also tested it successfully under a virtual machine.

Generate a random string

I always need that method in my unit tests !
There is several implementation around, but here is an interesting one, based upon temporary filename creation:

    ///      /// Get random string of 11 characters.     ///      /// Random string.     public static string GetRandomString()     {         string path = Path.GetRandomFileName();         path = path.Replace(".", ""); // Remove period.         return path;     }

Original article here:

Monday, May 04, 2009

Create a RSS feed natively with .NET 3.5 and C#

 

With the introduction of the System.ServiceModel.Syndication namespace, the 3.5 .Net framework allow us to read (it was talked in a previous post) and write RSS feed with a strongly typed API.

Here is a code snippet that show how to create an HttpHandler that render an RSS feed:

 

<%@ WebHandler Language="C#" Class="RssHandler" %>

using System;
using System.Web;
using System.Globalization;
using System.Collections.Generic;
using System.ServiceModel.Syndication;

public class RssHandler : IHttpHandler {

public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/xml";

SyndicationFeed myFeed = new SyndicationFeed();
myFeed.Title = new TextSyndicationContent("My Feed");
myFeed.Description = new TextSyndicationContent("My feed Description");

myFeed.Copyright = TextSyndicationContent.CreatePlaintextContent("Copyright jroland");
myFeed.Language = CultureInfo.CurrentCulture.Name;

List<SyndicationItem> feedItems = new List<SyndicationItem>();
for (int i = 0; i < 10; i++)
{
SyndicationItem item = new SyndicationItem();
item.Title = new TextSyndicationContent("Title " + i);
item.Summary = new TextSyndicationContent("Summary " + i);
item.PublishDate = new DateTimeOffset(DateTime.Now);

SyndicationPerson authInfo = new SyndicationPerson();
authInfo.Name = "John Roland";
item.Authors.Add(authInfo);

feedItems.Add(item);
}
myFeed.Items = feedItems;


System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create(context.Response.Output);
myFeed.SaveAsRss20(writer);
writer.Close();
}

public bool IsReusable {
get {
return false;
}
}

}

Wednesday, April 29, 2009

Taskbar on a second monitor – Free multi monitor TaskBar


Windows XP and Vista support multi monitor nicely, but the TaskBar is only available on one monitor only :-(.

Ultramon is a well known alternative, but cost money.

Alternatively you can use the free version “MultiMonitor TaskBar” edited by MediaChance.
It display a second taskbar with icons of the application opened on that monitor.

Download it here.

Friday, April 24, 2009

Sharepoint WSS 3.0 Service Pack 2

 

Service Pack 2 for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 due to ship April 28th

Office Service Pack team announced Service Pack 2 for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 would be available on April 28th. It provides many fixes and performance improvements, as well as some new features. Also with the new service pack, Internet Explorer 8 will be added into browser support matrix as level one, and Firefox 2.0 and 3.0 as level two. We recommend every customer to start planning their patch window to apply this service pack. Please look out for more details on April 28th.


for french readers La date de disponibilité du SP2 de MOSS 2007 et WSS 3.0 a été annoncée: cela sera le 28 Avril! Ce SP fournit de nombreux correctifs et améliorations de performances, ainsi que de nouvelles fonctionnalités. Le SP2 sera un pré-requis pour la mise à jour en version 2010 de SharePoint, il est donc recommandé de prévoir d’ores et déjà son application! Microsoft SharePoint Team Blog : Service Pack 2 for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 due to ship April 28th

Monday, April 20, 2009

Snippet Compiler – write and test c# code without saving


If you’re like me, you’re creating a lot of small console application to test some idea or even to just try a library or API. Snippet Compiler is a small tool that lets you quickly test small apps without having to save the code.

SnippetCompiler

Download the “Snippet Compiler” by Jeff Key.
http://www.sliver.com/dotnet/SnippetCompiler/

Friday, April 17, 2009

Free image / icons library for software programmers

Everyone knows that developer are poor when it come to icon or graphic design, so here is a free image / icons library named Silk that is very useful when you create a web site or an application and that you need some basic icons to start with.

From the author website:

“Silk” is a smooth, free icon set, containing over 700 16-by-16 pixel icons in strokably-soft PNG format. Containing a large variety of icons, you're sure to find something that tickles your fancy. And all for a low low price of $0.00. You can't say fairer than that.

Download it here