November 25, 2011

Changes to 64 bit application are not allowed

This message occurs because in 64bit mode CLR does not support "Edit and Continue". The simple workaround is to change target for project to x86 mode. In this mode application will be run as 32-bit application on 64-bits machine.

November 24, 2011

C# Examples in Visual Studio

Are you beginner in C#? Do you need more C# examples? You can find them in Visual Studio. Click Help -Samples. There are a lot of usefull examples. Enjoy

November 22, 2011

Effective C# - Part 1

Slides are based on "Effective C# (50 ways to improve your C#) Bill Wagner" book. Slides get quick overview over book and show specifics of C#. Presentation is useful for C# developers who want to use all power of this language.

November 16, 2011

How to create Relative Path in C#

It is pretty easy to create relative path in C#. Just what you need is to use System.Uri class.

Example:
System.Uri root = new System.Uri( @"C:\TestDir\" );
System.Uri filename = new System.Uri( @"C:\TestDir\MyTestLocation\MyFile.cs" );
System.Uri relativePath = root.MakeRelativeUri( filename )

Console.WriteLine( relativePath.toString() );
At the Output you will see "../MyTestLocation/MyFile.cs".