How to compile C# 3.0 code dynamically

December 20, 2007

One of major features being shipped with Visual Studio 2008 was new version of C# language. When one creates new C# project in Visual Studio 2008 it can choose target framework version, which enables functionality/IntelliSense targeted to selected framework. But how some runtime generated code could be compiled with specific framework target? In .NET v3.5 we got new overload to CSharpCodeProvider class, which takes "providerOptions" argument. This argument type is IDictionary<string, string> which could be used co configure compiler properties. Here is code sample, how to compile some basic runtime generated LINQ query: ...
no comments

Anonymous Delegates vs Lambda Expressions vs Function Calls Performance

December 11, 2007

Recently I've worked on some project, where I needed to investigate performance issue. After some investigation, some profiling I've got suspicion, that some function being called a lot of times (more than 100,000 calls in some very specific and relatively short execution path) in profiled code part. It was to strange to see, how relatively simple function consuming so much CPU time. The function did some relative simple arithmetic calculations, based on 2-3 received as parameters. While trying to solve this, I've created some test project to simulate the situation. Lets assume, we have the following function: ...

Preview of ASP.NET 3.5 Extensions CTP was Released

Microsoft released today the first CTP preview of an "ASP.NET 3.5 Extensions". This first ASP.NET 3.5 Extensions preview release includes: ASP.NET AJAX Improvements: New ASP.NET AJAX features in the ASP.NET 3.5 Extensions release include better browser history support (back/forward button integration, and server-side history management support), improved AJAX content linking support with permalinks, and additional JavaScript library improvements. ASP.NET MVC: This model view controller (MVC) framework for ASP.NET provides a structured model that enables a clear separation of concerns within web applications, and makes it easier to unit...
no comments

Silverlight and JavaScript interoperability – it’s really simple

December 6, 2007

I'd like to answer on one of very frequent question I've been asked by great many developers, which playing with Silverlight v1.1 Alpha. So, how one can execute managed code from JavaScript, and how JavaScript can get notification (event) from Silverlight (and possibly lunch some JavaScript functionality)? Well, it's pretty simple. First, lets create Silverlight project (I'm using Visual Studio 2008 with Silverlight tools for Visual Studio 2008 installed). Well... After creating the projects, let's do some coding... First of all, let's add some HTML button to out TestPage... <input id="Button2" type="button"...

Parallel Extensions CTP – What and Why?

Recently I've downloaded Microsoft Parallel Extensions to the .NET Framework CTP and installed it on my laptop... From extensions documentation and Extensions Developers blog I've got very a picture of new "nice" additional which could improve performance in some cases in .net applications. Now, after installing, playing with it and launching included samples I'm very confused about very important think: it supposed to work faster, that single threaded application? If yes, why I'm getting such strange behavior: My CPU is worked very hard to calculate those results, and I have pretty strong Dell Precision laptop:...

First Post

Hello and welcome to my blog! My name is Alex Golesh. I'm .Net consultant and instructor at Sela. I love to develop and love to research new technologies. This is my first post in blog...   Here is short preview of what will be here: if (You.InterestedIn(new string {"Silverlight", "WPF", "LINQ", ".NET Developing", "CSharp"})) Console.WriteLine("Welcome to my blog!"); else Console.WriteLine("Where do you want to go today?");   Will be glad to see you again, Alex