רשמים וחידושים מכנס Build 2016

Sunday, April 10, 2016

שבוע שעבר נערך כנס מפתחי התוכנה השנתי הגדול של מיקרוסופט – Microsoft Build – בו השתתפתי ביחד עם משלחת גדולה מאנשי CodeValue ואף הצגנו בדוכן בתערוכה את OzCode – תוסף ה-Debugging שלנו ל-Visual Studio. במהלך הכנס, שהתקיים כרגיל בסן-פרנסיסקו, הוכרזו והוצגו מספר רב של חידושים עבור הפלטפורמות הטכנולוגיות השונות של מיקרוסופט אשר את עיקריהן אסקור במאמר זה. לקריאת המאמר המלא...

IoT at Israeli .NET Developer User Group

Sunday, June 14, 2015

 IoT is Hot IoT gets all the hype these days. It is the new buzzword and soon it will be in every part of our life. But what are the parts that compose an IoT project? What is the correct way to build it? In case you haven’t heard, Tamir Dresher and myself are presenting a lecture this Wednesday at the Israeli .NET Developer User Group on IoT and the cloud – with .NET! In this session we will look at how to build an IoT system using devices, sensors and the Cloud. We will demonstrate working with sensors in C#...
no comments

Released: Code Contracts VS2012 Editor Extensions

Sunday, March 24, 2013

Code Contracts is an experimental project from Microsoft Research which provides a language-agnostic way to express coding assumptions in .NET programs, thus allowing for improved testability, static verification at compile time and automatic API documentation. If you participated in my session about Code Contracts last week, then you already know that. At my session, I said that Microsoft has not yet released the Code Contracts Editor Extensions for VS2012. Well that, my friends, has changed… Microsoft has just released the Code Contracts Editor Extensions for VS2012! This extension allows you display Code Contracts in code, Intellisense and...
no comments

WF 4.5 and Code Contracts: Slide Decks and Code

Thursday, March 21, 2013

I’d like to thank all those who attended yesterday’s sessions at the Israeli .NET Developer User Group. I had a good time delivering the sessions, and I hope you enjoyed them as well. What’s New in Windows Workflow Foundation (WF) 4.5? Sample code for the session can be found here. Enhance Your Code Quality with Code Contracts Sample code for the session can be found here. If you attended the session and have an open question, feel free to ask. See you next time!...
no comments

Upcoming Event: Code Contracts Lecture

Monday, March 11, 2013

If you ever used a 3rd party API, you surely know the importance of proper documentation - Can this method return "null"? Do I have to check this return value? What are the valid values of this argument? You also probably know that the only way to discover if your assumptions are correct is to execute the code and pray that exceptions won't be flying around. There must be a better way! Enter "Code Contracts". Code Contracts is an experimental project from Microsoft Research which provides a language-agnostic way to express coding assumptions in .NET programs, thus allowing...
no comments

Accessing the AggregateException with await

Monday, December 31, 2012

The await keyword is a new keyword in C# 5.0 which, in tandem with async keyword, allows us to easily author methods which execute asynchronously in regards to the calling code. In previous posts I’ve shown certain issues you should look out for when using these keyword. In this post we’ll look at another issue with the await keyword – how to access the AggregateException. await Only Throws One Exception As we saw in a previous post, await (unlike Task.Wait()) does not wrap a thrown exception in an AggregateException and instead just re-throws the exception thrown within...
no comments

Task.Wait() vs. await

Sunday, December 23, 2012

The await keyword is a new keyword in C# 5.0 which, in tandem with async keyword, allows us to easily author methods which execute asynchronously in regards to the calling code. In a previous post I’ve shown a certain issue you should look out for when using the async keyword. In this post we’ll check a similar issue with the await keyword. The await Trap Let’s remember our test code from the previous post: class AsyncClass { public void Process(string s) { if (s == null) throw new ArgumentNullException("s"); ...
no comments

The async Keyword and Thrown Exceptions

Monday, November 12, 2012

async is a new keyword in C# 5.0 which allows us to easily author methods which execute asynchronously in regards to the calling code. The calling code can call the async method and continue its execution until it decides to join with the called method at a later stage. The async Trap Consider the following method: public void Process(string s) { if (s == null) throw new ArgumentNullException("s"); ProcessCore(s); } private void ProcessCore(string s) { for (int len = 1; len <= s.Length; len++) { ...
no comments

.NET Finalize() and Constructor Exceptions

Wednesday, October 24, 2012

The Finalize() method in .NET is a special method which allows performing cleanup operations when a managed object is being garbage collected. Overriding this method is usually done in order to release unmanaged resources owned by managed object, resources which the .NET garbage collector is unaware of. The Finalize() Riddle As most .NET developers are aware of, when a managed object which overrides the Finalize() method is marked for garbage collection, it is moved to the finalization queue where a dedicated thread executes the cleanup code and then the object can be released. However, consider the...
no comments

Invoking the Static Constructor via Reflection

Thursday, June 17, 2010

-- Warning! -- This post may cause the reader a slight feeling of nausea. However, remember that tough situations call for some tough actions! The Situation Imagine that you have to write some-unit tests for a class which uses an existing infrastructure, involving calls to static methods on a static class. To make things worse, this static class also holds some state which, unfortunately, gets carried around between tests without no actual ability to clear it.     public static class MyInfrastructureClass    {        private static Dictionary<int, string> _someState = ...
tags: , , ,
5 comments