Browse by Tags

All Tags » C# (RSS)

Perhaps this post should have been out before my previous one the topic. Anyway, continuing the journey on Managed Extensibility Framework (MEF) in .NET, let us see how we can attach metadata to an exported type and how it can be retrieved on the importing side, all in short steps (I am not going to spend much time and dig deep in to each of the available options; this objective here is simply to highlight the available options). I cannot stress enough the importance of metadata in MEF and discuss various scenarios where it proves useful. Nevertheless, 

...
Posted by Siva M | with no comments
Filed under: , , , ,

I have been playing around with Managed Extensibility Framework (MEF) of .NET 4.5 for a while now. Overall, it is a great framework for designing many plug-in/extensibility scenarios of .NET applications, web, desktop or even Windows Store (Metro). One area that got interesting in my MEF experiment was the way in which metadata worked in the case of inherited exports. As you know...

...
Posted by Siva M | with no comments

With v4.5, zip archival handling comes natively to .NET. No longer do you have to rely on 3rd party components to create, manage and extract zip files, though most of them are free.

...
Posted by Siva M | with no comments
Filed under: ,
Windows Server AppFabric version 1.1 has worthy improvements over its predecessor version. The first from my v1.1 favorites list is the ability to retrieve data from data sources when the client-requested data is not available in the cache ("cache...
Posted by Siva M | 4 comment(s)
Filed under: , , ,
There are quite a many gems hidden in C# and .NET Framework. Here are some: ?? operator C# 2 introduced the concept of nullable value types. If you assign a nullable value type to a non-nullable variable and if the former is null, you will get a runtime...
Posted by Siva M | with no comments
Filed under:
Yesterday, I came across a question in one of the .NET newsgroups asking how to get the IP address of the DNS servers available in the network. Though there is no direct way of getting this information (yet, at least to my knowledge) via .NET 2.0 class...
Posted by Siva M | with no comments
Filed under: , ,
It is very common in Windows applications to store application-wide data such as database connection strings, application title and folder path,etc that should be available for the duration of the application instance. The general strategy for storing...
Posted by Siva M | with no comments
Filed under: , ,
Today I saw a question in the ASP.NET newsgroup asking about implementing a static (non-hyperlinked) site map path. As you know, the SiteMapPath control in ASP.NET 2.0 displays a breadcrumb showing the current spot in the site map navigation defined in...
Posted by Siva M | with no comments
Filed under: ,
There was a question from an internal group asking for a way to programmatically change the log on name (and of course password) of a Windows service - this is the user account, local or domain, under which the service process runs when started. Unfortunately...
Posted by Siva M | with no comments
Filed under: ,
One of the features of the ASP.NET application that I am currently working on requires copying dynamically generated files to a network share path. As guessed(!), the user identity of the ASP.NET worker process (IIS application pool, in case of Windows...
Posted by Siva M | with no comments
Filed under: , ,
One of the new diagnostics tools introduced in .NET 2.0 is the System.Diagnostics.StopWatch class. It lets you time your code with simplest profiling code possible! And I use this class very regularly during my development/desting. I use it especially...
Posted by Siva M | with no comments
Filed under: ,
I saw a newsgroup post today asking about programmatically (.NET way) switching Internet Explorer to offline mode (checking IE's File | Work Offline menu item). I posted a small C# code that accomplishes this to the newsgroup. Thought would make a blog...
Posted by Siva M | 1 comment(s)
Filed under: ,
The System.Diagnostics.Process class gives almost every data about a running process. But, the most-wanted information it doesn't give about a process is the process owner name. And I ran across a situation recently that asked for the same thing - here...
Posted by Siva M | 8 comment(s)
Filed under: ,
I was recently tasked with developing a utility for Tablet PC - this utility will let users sign using pen/ink and store the signature as an image file. Trust me, I have not even touched a tablet PC before (shameful!) and thinking about writing a utility...
Posted by Siva M | with no comments
Filed under: ,