Posts filed under ‘.net’

Code Coverage with TestDriven.Net in Visual Studio 2003

In VS2003 you can’t add your .exe to project reference of separate test assembly. So it is well known practice to copy it to some folder, rename to .dll and reference it from there. (Note: VS2005 allows you to reference .exe)

After performing such steps when you run Coverage from TestDriven.Net context menu, you can notice that there is coverage only for the test assembly.

Solution: Many chances you didn’t copy .pdb file for the .exe, but NCover can only profile assemblies which have .pdb files for them

October 30, 2007 at 11:22 am Leave a comment

Html attributes, single quote and HtmlAttributeEncode

When you develop your own custom controls do not forget that HtmlAttributeEncode method DOES NOT encode single quote.

MSDN says:

The string result from the HtmlAttributeEncode method should be used only for double-quoted attributes. Security issues might arise when using the HtmlAttributeEncode method with single-quoted attributes.

So you should use double quotes

September 11, 2007 at 11:33 am Leave a comment

New Lightweight Dependency Injection Framework for .NET – Ninject

Ninject (earlier known as Titan) is a Lightweight Dependency Injection Framework for .NET inspired by Google’s Guice.

From what I can read it from the docs it is really nice for small projects and allows you to live without creating large xml files for configuration and it also uses .NET 2.0+ DynamicMethods to improve object creation speed.

I am going to give it a shot!

September 5, 2007 at 3:11 pm 1 comment

Little-known C# 2.0 operator – ??

Excerpt from the msdn:

The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand.

Example:

string s = null; 
int? i = null; 
Console.WriteLine(s ?? "(null)"); 
Console.WriteLine(i ?? -1);

Will produce:

(null) 
-1

August 21, 2007 at 2:39 pm 2 comments

Links For Continuous Learners

Today I’ve spotted nice Steve Pietrek’s blog where he puts links to miscellaneous articles about .Net and related technologies

http://spietrek.blogspot.com/

August 20, 2007 at 9:44 am Leave a comment


Calendar

June 2017
M T W T F S S
« Oct    
 1234
567891011
12131415161718
19202122232425
2627282930  

Posts by Month

Posts by Category