|
|
Creating Your Own NuGet Package |
|
NuGet is a free and open source package management system for .NET applications. The primary goal of NuGet is to help developers simplify the process of incorporating third party libraries into their .NET applications. There are several NuGet packages available for you to use or you can build your own. This step-by-step article shows what it takes to create your own NuGet package. The package can then be submitted to NuGet Gallery or can be hosted locally. |
|
Posted On : 24 Sep 2011 |
|
|
Generating Code Using Text Template Transformation Toolkit (T4) |
|
Many times developers come across situations where they need to write similar code over and over again. Automating the generation of such boilerplate code not only reduces the time spent but also reduces the chances of errors while doing such monotonous development. To help developers achieve this goal, Visual Studio 2010 includes what is known as Text Template Transformation Toolkit (T4). T4 templates are text files that specify the structure of the code or markup to produce. T4 comes with its own set of directives and blocks, which allow you to you define the boilerplate for code generation. This article introduces you to T4 basics and familiarizes you with the various parts of a T4 template. |
|
Posted On : 11 Aug 2011 |
|
|
Using Visual Studio Debugger Attributes |
|
Visual Studio provides a rich debugging experience to developers, helping them write robust and bug free code. In simple projects, the inbuilt facilities of Visual Studio debugger may be sufficient for your purpose, however, while debugging complex projects you may want to enhance the debugging experience further. Luckily, Visual Studio offers debugger attributes that help you do just that. Debugger attributes allow you to customize the way Visual Studio debugger steps through your code and also the display of your types. This article explains some of the important debugger attributes along with debugger type proxies and visualizers. |
|
Posted On : 23 Jul 2011 |
|
|
Working with Regular Expressions in .NET |
|
Regular Expressions provide a standard and powerful way of pattern matching for text data. The .NET Framework exposes its regular expression engine via System.Text.RegularExpressions Namespace. The Regex class is the primary way for developers to perform pattern matching, search and replace, and splitting operations on a string. Many beginners avoid using regular expressions because of the apparently difficult syntax. However, if your application calls for heavy pattern matching then learning and using regular expressions over ordinary string manipulation functions is strongly recommended. This article is intended to give beginners a quick overview of .NET Framework's offerings for pattern matching using regular expressions. |
|
Posted On : 16 Jul 2011 |
|
|
Using DynamicObject and ExpandoObject |
|
C# is primarily a statically typed language. That means the compiler needs to know in advance about the data type of a variable. In the absence of this information, the compiler will throw a compilation error and will refuse to compile the code. In spite of the advantages offered by the statically typed languages, dynamic languages have their own place in application development. For example, most of the web sites developed today make use of JavaScript in some way or the other. Languages such as Python and Ruby are also popular amongst developers. The C# language now supports dynamic features through Dynamic Language Runtime (DLR). Part of these features include dynamic types, DynamicObject Class and ExpandoObject Class. This article explains these features and provides examples illustrating how these features are used. |
|
Posted On : 12 Jul 2011 |
|
|
Using Extension Methods |
|
How often do you want to modify existing classes to have extra methods? Quite often. Right? When you have source code of the classes under consideration at your hand then things are easy. You probably just add the extra methods to those classes. What if you don't have source code? Well. In such cases one approach is to inherit the existing classes and add extra methods to the child classes. However, this way may not be always correct and possible in terms of your application design and OO principles. Luckily, C# offers a quick way to extend your class functionality through a feature known as Extension Methods. Extension methods allow you to extend existing types without inheriting them. This article is going to throw some light on this handy feature.
|
|
Posted On : 04 Aug 2008 |
|
|
Zip and Unzip files programmatically |
|
Recently one of the reader of DotNetBips.com posted a question on the discussion forums about compressing and decompressing files via code. There is no obvious answer to this question because C# and VB.NET lack this functionality. However, J# does have a way to zip and unzip files programmatically. In this article I am going to explain how this can be achieved. In this article you will develop a reusable class library that can be used to create, extract and alter ZIP files. Once developed you can use it in your Windows or web applications.
|
|
Posted On : 03 Feb 2007 |
|
|
Get a Complete Computer List From Active Directory Using .NET 2.0 |
|
This code sample shows how to retrieve a list of computers from Active Directory and use a For/Next to loop through the collection. I've used this code sample on several scripts and using Active Directory as the authoritative source for a list of machines is handy. The process running this code sample normally requires being a domain administrator level to retrieve this information.
|
|
Posted On : 05 Dec 2006 |
|
|
Refactoring your code with VS.NET 2005 |
|
There are developers who write code and then there are developers who write better code. The difference is obvious. Writing good code is skill that not all developers have. This also implies that this skill can be improved. A part of this skill includes ability to refactor the code that you or somebody else has written. VS.NET 2005 includes a set of features that help you in this regards. This article is going to discuss what refactoring is and how VS.NET 2005 helps you to refactor your code.
|
|
Posted On : 02 Jun 2006 |
|
|
|
|