Rakesh Rajan's blog

Thoughts on .NET, software and a few trivial things...

Browse by Tags

All Tags » .NET FAQ (RSS)
Sorry, but there are no more tags available to filter with.
XML Serialize IDictionary types (Hashtable, DictionaryBase etc.)
Problem You want to serialize a type; however it: implements IDictionary , or derives from DictionaryBase , contains a member which implements IDictionary or derives from DictionaryBase , which causes XmlSerializer to throw an exception: "System.NotSupportedException...
Posted: Jan 15 2006, 12:42 PM by rakeshrajan | with no comments
Filed under:
.NET Certifications FAQ
This is something that comes up frequently. Check out the below link I wrote a long long time ago. Hope it has some helpful information. Please drop me a mail if you have questions. http://t-mug.org/certification.aspx
Posted: Sep 23 2005, 01:57 AM by rakeshrajan | with no comments
Filed under:
How to make Visual Studio .NET create web projects in a user defined folder
Just published this here: http://support.microsoft.com/kb/555436
Posted: Aug 22 2005, 09:57 AM by rakeshrajan | with 5 comment(s)
Filed under:
How to share custom application configuration settings across projects in .NET
Just published this here: http://support.microsoft.com/kb/555396 Interestingly, I had stumbled upon this while answering this post: http://www.msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.general&mid=ff9719e6-3829-4122-8b23...
Posted: Aug 16 2005, 02:12 PM by rakeshrajan | with 3 comment(s)
Filed under:
Why Multiple Inheritance was not implemented in .NET
Just came across this blog entry on why Multiple Inheritance was not implemented in .NET. http://blogs.msdn.com/csharpfaq/archive/2004/03/07/85562.aspx
Posted: Jun 29 2005, 10:56 AM by rakeshrajan | with 20 comment(s)
Filed under:
How to find out the immediate calling method
Use the StackFrame and StackTrace classes. For example: public static void SourceMethod() { TargetMethod(); } public static void TargetMethod() { StackTrace st = new StackTrace(); // This will output 'SourceMethod' Console.WriteLine(st.GetFrame(1).GetMethod...
Posted: May 02 2005, 10:55 PM by rakeshrajan | with 2 comment(s)
Filed under:
Static readonly versus constants
Though both would appear similar – they are both read only and generate almost similar IL code – they have a number of differences. Here they are: Constants are evaluated at compile time, whereas static (or static readonly ) variables at runtime. So,...
Posted: May 01 2005, 11:03 AM by rakeshrajan | with 6 comment(s)
Filed under:
Override versus Hide (static binding versus dynamic binding)
Background This is a topic repeatedly asked about both online and offline. This entry explains the following OOPs concepts to help clear them: Method overriding and method hiding (implemented using the override and new keywords in C# and Overrides and...
Posted: May 01 2005, 12:56 AM by rakeshrajan | with 5 comment(s)
Filed under:
How to create a random (or unique) string (or number)
Problem You want to create a unique number for: using an a primary key in a table for security purposes like creating a salt to attach to a hash value Possible solutions Create a new GUID (Globally Unique Identifier) by using the GUID.NewGuid method Use...
Posted: Apr 14 2005, 11:34 AM by rakeshrajan | with 2 comment(s)
Filed under:
Find out the number of times a character is repeated in a string without using iteration
Problem You want to find out the number of times a specific character is repeated in a string, but you don't want to use iterative blocks like while, for etc.. Solution Use the Split method, and subtract 1 from the length of the string returned. Example...
Posted: Apr 14 2005, 11:24 AM by rakeshrajan | with 4 comment(s)
Filed under:
How to create a Plug-in architecture
Problem You want to create an application which could dynamically load ‘plug-ins’ at runtime. You want to do this because: you want other people to create plug-ins for your application without exposing your source code you have a module which keeps changing...
Posted: Apr 14 2005, 11:23 AM by rakeshrajan | with 2 comment(s)
Filed under:
Guidelines on naming conventions, standards etc.
MSDN has a paper which lays down guidelines on naming conventions, class member usages, exposing functionality etc. This is a must-see resource for all who want to use a standard convention while coding, to create class libraries and whoever else who...
Posted: Apr 14 2005, 11:21 AM by rakeshrajan | with 1 comment(s)
Filed under: