This project has moved and is read-only. For the latest updates, please go here.

Targeting .NET 4.5

Topics: Errors
Aug 4 at 7:19 PM
Hello, I am using your wonderful library in a class library where I am targeting .NET 4.5. I noticed that beginning with TaskScheduler 2.5.21 (and through 2.5.28) I would receive the following compilation error (I am using IReadOnlyList in my code):

The type 'IReadOnlyList<T>' exists in both 'Microsoft.Win32.TaskScheduler, Version=2.5.21.0, Culture=neutral, PublicKeyToken=0d013ddd5178a2ae' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


So for now I am just sticking with 2.5.20 which does not have the issue. I noticed from looking at code on GitHub that there is a constant defined based on the target framework but I'm guessing it is not quite working right, at least in my environment. Anyway, just wanted to point out, thank you!
Aug 5 at 6:25 PM
The NuGet package provides builds for .NET 2.0, 3.5, 4.0 and 4.5.2 as recommended by Microsoft. If you build against 4.5, NuGet Package Manager will pick the 4.0 package which does include the IReadOnlyList interface since it was not included in the full .NET library until 4.5. If you compile against 4.5.2, you will not see the problem and you will avoid some of security vulnerabilities that were fixed in 4.5.2.