Posted by dimarzionist under
.Net,
Technical | Tags:
C# 4.0,
CLR,
DLR,
Dynamic Types |
1 Comment
There are several important concepts related to new dynamic types in C# 4.0 which could be a bit confusing without correct understanding of boxing/unboxing of value types that happens during the dynamic binding.
Here is good example from Sam Ng’s blog:
public struct S
{
public int i;
}
public class D
{
public S s;
public static void Main()
{
dynamic d = new D();
d.s = default(S);
d.s.i = 10;
Console.WriteLine(d.s.i);
}
}
We would intuitively expect the value ‘10′ to be printed in the console. However, the value ‘0′ is printed instead. Core thing is any of the dotted expressions were to bind to a value type, that value will be boxed (and hence a copy would be made), and further dots into it would be made on the copy of the value, and not the initial value as would be expected.
The guys from C# team currently on the way of investigation if it’s reasonable to add any smart compile time logic to handle things like this for dynamic usage. But from my perspective main thing is to understand the reason for this – real value type was unboxed during dotted expression and modified, but wasn’t(!) boxed again.
I’m usually reading all MSDN Architecture Journal articles and I found recently that there is a simple and comfort way to read and store its articles. Architecture Journal Reader is not something new, but I’ve rediscovered it recently and find it really convenient and helpful.
It contains list of all issued journals and detailed table of content for each. Pretty much it looks like newspaper and really intuitive in use and referencing.

Here is direct link to Download Page – Download Architecture Journal Reader
During last couple of days I had to make lots of TFS tasks with my colleagues in Dev Centre. Part of them was bulk of administrative tasks to assign correct permissions to different areas of the TFS such as Source Control, Share Point, Reports and other. All this areas have independent roles and permissions configuration and it’s not really easy using standard tools to give the same permissions to someone in these different sub-areas. What we’ve discovered was the TFS Administrator tool on CodePlex that allows you easily to manage multiple permission sets for different projects and users. We found this as fast enough way for tasks we have, and I could recommend it to use in such scenarios.

TFS Administrator Screen shot
I’ve experienced some problems with VPN connections after installing OneCare from Microsoft. As result of diving into configuration I’ve found that there is an option under the Firewall configuration options that denies any VPN connections by default.
In order to fix this you’ll need to go to Advanced settings of Firewall and under the ports and protocols tab put the mark near the VPN networks (IPsec or PPTP) in the checkbox list as shown in the picture below.

VPN setting inside OneCare configuration