• Pedram Rezaei

    System.Core.dll of .NET Framework 3.5

    • 2 Comments
    I recently wrote an MSDN Flash article on the hidden gems of System.Core.dll of .NET Framework 3.5 which was published in the October issue of the MSDN Flash . Here is a copy of that article: If you have played with Visual Studio 2008, chances are...
  • Pedram Rezaei

    A Performance Comparison of ReaderWriterLockSlim with ReaderWriterLock

    • 5 Comments
    If you have ever used the System.Threading.ReaderWriterLock to achieve synchronised access to shared resources which are frequently read but infrequently updated then you probably know why we have created a new Reader/Write lock. In this MSDN Magazine...
  • Pedram Rezaei

    WCF Authentication: Custom Username and Password Validator

    • 32 Comments
    There are a number of authentication techniques supported by WCF. For instance Windows Authentication, X509 Certificates, Issued Tokens, and Username and Password are all mechanisms that can be used for authentication. These client credential types...
  • Pedram Rezaei

    AzMan Data Store through COM Interop

    • 2 Comments
    If you have an ASP.NET application, you can use the AuthorizationStoreRoleProvider which adheres to the Role Provider model expected by ASP.NET and retrieves role information from Microsoft Authorization Manager (AzMan). AzMan itself is a COM based...
  • Pedram Rezaei

    Reversible Command Pattern

    • 3 Comments
    The Reversible Command design pattern encapsulates a request or an operation as an object, thereby allowing you to queue, log, and serialize requests to a store (volatile or durable) and create undo or rollback requests. With this pattern you basically...
  • Pedram Rezaei

    ThreadAbortException and Unmanaged Code

    • 1 Comments
    As you are probably aware Thread.Abort() raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Please note that if Abort is called on a managed thread while it is executing unmanaged code...
  • Pedram Rezaei

    How the Execution Timeout is managed in ASP.NET

    • 11 Comments
    As you are probably aware, it is possible to specify the execution timeout of an ASP.NET request through the config file. All you need to do is to set the executionTimeout attribute on the httpRuntime element in either the web.config (for one ASP.NET...
  • Pedram Rezaei

    Customising WCF Proxy Generation in Visual Studio 2008

    • 16 Comments
    I was asked today how easy it is to hook into the WCF client proxy generation process in Visual Studio 2008. The answer is “It is very easy”. Visual Studio has this great extensibility point that allows third-parties to create “Custom Tools” for specific...
  • Pedram Rezaei

    .NET ServicedComponents and STA Apartment

    • 6 Comments
    A major issue with running all COM components using STA threads is that the thread which calls CoInitializeEx must be the only thread executing method invocations on that COM instance. Now assume a scenario in which the STA thread is busy performing other...
  • Pedram Rezaei

    .NET Thread Apartment and COM Interop

    • 3 Comments
    Before a thread can call into a COM object it has to define its apartment by declaring whether it will enter a single-threaded apartment (STA) or a multi-threaded apartment (MTA). STA client threads call CoInitialize(NULL) or CoInitializeEx(0, COINIT_APARTMENTTHREADED...
  • Pedram Rezaei

    Dedicated thread or a Threadpool thread?

    • 3 Comments
    Each .NET CLR based process is given a pool of threads. The size of the thread pool is configurable however by default the maximum number of threads created by the thread pool is set to 1000 IO threads in total, and 25 worker threads per logical or physical...
  • Pedram Rezaei

    Automated build of Satellite Assemblies in Visual Studio with MSBUILD

    • 2 Comments
    Download sample code Much has been said and written about satellite assemblies and localization techniques that are achieved using them. I believe that most of the industry has no doubt in the usefulness of this amazing feature of the .NET Framework;...
  • Pedram Rezaei

    XML Configuration for .NET Applications

    • 2 Comments
    There are at least 2 options to consider for using user-specific configurations: - Custom configuration mechanism: using technologies such as the XML Serializer. - XML Configuration feature in .NET 2.0: This is the main topic of this blog entry...
  • Pedram Rezaei

    Store any data in SQL Server 2008 (Katmai)

    • 5 Comments
    SQL Server 2008 (aka Katmai) allows seamless transition between relational and nonrelational data, enabling users to access documents as data, encode complex XML hierarchies within XML, and query across relational and text data. So how is this achieved...
  • Pedram Rezaei

    Lambda Expressions in C#

    • 3 Comments
    Before being able to talk about Lambda expressions, I need to wet your appetite by touching on the difference between Expressions and Statements: i = j; while (a) f(b); The above listing is an illustration of 2 statements. As you can see evaluation...
  • Pedram Rezaei

    Lazy evaluation in C#

    • 5 Comments
    What is lazy evaluation? If you ask a functional programming enthusiast, you will probably get a reply similar to the one below: “Oh well, allow me to enlighten you: - In lazy evaluation, computation terminates whenever any reduction order terminates...
  • Pedram Rezaei

    Extension methods in C# 3.0

    • 5 Comments
    You can think of extension methods as the ability to add instance methods to already existing types. Having said that, I would immediately also tell you that it is just an illusion. You are not actually adding a method to an existing type. It is just...
  • Pedram Rezaei

    Local variable type inference in C# 3.0

    • 1 Comments
    In C# 1.0 type declaration was very simple: - Specify the type name (if an array then append [] to the end of the type) - Follow by a local variable name Here are some examples of this: int i = 23; double [] ds = new double [] { 1.0, 2...
  • Pedram Rezaei

    SQL Server 2005 Database Mirroring

    • 3 Comments
    Customers often raise the following concerns and questions regarding the Database Mirroring feature of SQL Server 2005. In here, Don Vilen a Program Manager for SQL Server Database Mirroring and I have responded to some of these concerns and questions...
  • Pedram Rezaei

    How to maintain state in a data-driven unit test

    • 0 Comments
    Imagine you need to maintain a list of processed data rows in a running data-driven unit test. Well, you can use the code below as a starting point: [ DataSource ( "System.Data.SqlClient" , "Data Source=.;Initial Catalog=FeatureDemo;Integrated Security...
  • Pedram Rezaei

    SQL Server 2005 Compact Edition is now available

    • 1 Comments
    SQL Server 2005 Compact edition runs as an in-process application, with a very small footprint (less than 2 MB disk footprint) offering you a good subset of the T-SQL features, and replication features of a full blown SQL install. DB Size is capped at...
  • Pedram Rezaei

    Use of string.Format for the purpose of tracing

    • 0 Comments
    Application tracing is usually turned off on production releases. Therefore it is recommended not to use string formatting methods if their output is being ignored. string.Format is usually an expensive method and should be avoided if its output is not...
  • Pedram Rezaei

    Non-CLS Exceptions

    • 0 Comments
    Many developers are not aware that according to CLR it is perfectly OK to throw exceptions which are NOT derived from System. Exception : Exceptions such as DateTime, Int64 and String. Although languages such as C# do not allows programmers to throw these...
  • Pedram Rezaei

    SQL Service Broker: The Impatient Way!

    • 0 Comments
    For those of you who are interested in creating your first SQL Server 2005 Service Broker conversation but are impatient as I am, just grab the code below and give it a try: -- Enable service broker alter database [YOUR_DB_NAME] set enable_broker ...
  • Pedram Rezaei

    WCF Tools

    • 0 Comments
    WCF provides a number of tools that make it easier to create, deploy, and administer WCF applications. Tool Name Description COM+ Service Model Configuration Tool (ComSvcConfig.exe) This is a utility used to configure...
Page 2 of 3 (54 items) 123