Tag Archives: dotnet

Working with DirectoryCatalog in MEF

As I have already discussed some of the Catalogs present in MEF library viz, TypeCatalog, AssemblyCatalog etc, where AssemblyCatalog is actually a collection of TypeCatalog internally, DirectoryCatalog on the other hand is a collection of AssemblyCatalog. In this post I will look into DirectoryCatalog and how to use this class while writing your MEF application. DirectoryCatalog is a… Read More »

Async Lambda Expression

Do you know what is coming next to C#? Asynchronous programming is really made easy with the inclusion of new contextual keywords to C# namely async and await. If you are unaware of it, I would really suggest you to read few of my posts like : C# 5.0 vNext Async support for Silverlight and WP7 Debugging with… Read More »

Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format. : A solution

Few days back, I was migrating my application for VS2008 to VS2010 and it was done successfully except  some people started running the application. They faced the error as below “Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format. “ I tried to… Read More »

Compiler directive #Pragma reference

Compiler directives is always a fun for any language. There are lots of talks around different blogs on compiler directives but there are hardly any talks around my favorite #pragma directives. So lets talk what it is and what it is capable of. In general, Pragma directives are special instruction to the compiler when it compiles a file.… Read More »

Collection Initializers in .NET

Many of you have used property initializers in your code. Object initializers and property initializers are common operations of every program. But do you know, .NET supports Collection initilization directly for all IEnumerable objects ? In this post lets take a brief introduction of Collection Initializers in .NET. Suppose you want to create an array which holds some… Read More »