Archive

Posts Tagged ‘.Net-4.0’

.Net Framework 4.0 and VS2010 – things that I don’t like

March 11th, 2011 No comments

There are many great improoves (e.g. TPL – see my post about Task Parallel Library)

Still, there are some disadvantages, I would like to list:

1. Help interface is uncomfortable, there is no possibility to search by Index like it was working in “chm” in VS2003-8

Update: after installing Visual Studio 2010 Service Pack 1 (SP1) – help user interface become more user friendly and handy.
2. CLR debugger doesn’t working any more (SDK v2.0) – such behavior is very crucial for our clients and deployment process.

  • Native code debugger cause my VS2010 to stuck all the time.

3. GAC changes – why v2.0 and v4.0 assemblies are located in different locations?
a. Why simple copy/paste operation doesn’t working like its work today with c:\windows\assemblies directory.
b. Why we need to manage two different GAC’s?
Detailed info regarding GAC can be found here: http://msdn.microsoft.com/en-us/magazine/dd727509.aspx

Read more…

Categories: .Net Tags: ,

.Net 4.0 first tasting – Task Parallel Library (TPL)

March 11th, 2011 1 comment

Finally our project was “upgraded” to VS2010 and .Net 4.0, we was waiting anxiously for that event.
In first opportunity I have tried to use new language/Framework features like Parallel.Foreach and PLINQ.

My task was to aggregate duration time of recorded stuff (it doesn’t really matter what data I needed to sum). In order to retrieve required data and calculate it – we have had to communicate with the server (TCP protocol). Such operations of course are time consuming so I decided to use Parallel.Foreach.

See following code example:

15 public TimeSpan GetRecordedDuration(int recordingId)

16 {

17       TimeSpan duration = TimeSpan.Zero;

18       Parallel.ForEach(GetGroups(recordingId), group =>

19       {

20

21         var bookmarks = m_clientRecordingSys.GetGroupBookmarks(StreamsNames.VideoSourceName, group);

22         if (bookmarks.Count <= 1)

23         {

24             continue;

25         }

26         else

27       {

28       var startTime = TimeSpan.FromTicks(bookmarks[0].CreationTime);

29 var endTime   = TimeSpan.FromTicks(bookmarks[bookmarks.Count – 1].CreationTime);

30 duration += endTime – startTime;

31    }

32  }

33    );

34   return duration;

35

36 }

37

38 }

Read more…

Categories: .Net Tags: ,