Top ".net-4.0" questions

Version 4.0 of the .NET Framework.

Exception: "URI formats are not supported"

I have an absolute local path pointing to a dir: "file:\\C:\\Users\\john\\documents\\visual studio 2010\\Projects\\proj" But …

c# .net .net-4.0
Creating threads - Task.Factory.StartNew vs new Thread()

I am just learning about the new Threading and Parallel libraries in .Net 4 In the past I would create a …

c# .net multithreading .net-4.0
How to abort a Task like aborting a Thread (Thread.Abort method)?

We could abort a Thread like this: Thread thread = new Thread(SomeMethod); . . . thread.Abort(); But can I abort a Task (…

c# .net parallel-processing .net-4.0
Installing MSBuild 4.0 without Visual Studio 2010

I installed .NET 4.0 and VS 2010 RC on my laptop and MSBuild was automatically installed. I was hoping to build a …

.net visual-studio-2010 msbuild sdk .net-4.0
When should TaskCompletionSource<T> be used?

AFAIK, all it knows is that at some point, its SetResult or SetException method is being called to complete the …

c# .net .net-4.0 task-parallel-library taskcompletionsource
C# operator overload for `+=`?

I am trying to do operator overloads for +=, but I can't. I can only make an operator overload for +. How …

c# .net c#-4.0 .net-4.0 operator-overloading
How to clear MemoryCache?

I have created a cache using the MemoryCache class. I add some items to it but when I need to …

c# caching memory .net-4.0 memorycache
Cleaner way to do a null check in C#?

Suppose, I have this interface, interface IContact { IAddress address { get; set; } } interface IAddress { string city { get; set; } } class Person : IPerson { …

c# .net-4.0 null .net-4.5
Show Dialog box at center of its parent

It's been a mess to show a DialogBox at the center of its parent form. Here is a method to …

c# winforms .net-4.0 positioning center
What are best practices for using SmtpClient, SendAsync and Dispose under .NET 4.0

I'm a bit perplexed on how to manage SmtpClient now that it is disposable, especially if I make calls using …

c# .net-4.0 smtpclient