Steps to reproduce:
1) Create a new Console Application using .NET Framework 4.5.1
2) Install TaskScheduler NuGet-package version 2.5.17 (Install-Package TaskScheduler)
3) Add following line to Main-method:
using (var ts = new TaskService()) {}
4) Build the solution. Build fails on compiler error:
warning MSB3274: The primary reference "Microsoft.Win32.TaskScheduler, Version=2.5.17.0, Culture=neutral, PublicKeyToken=0d013ddd5178a2ae, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.1".
error CS0234: The type or namespace name 'TaskScheduler' does not exist in the namespace 'Microsoft.Win32' (are you missing an assembly reference?)
I suspect this is because the binaries in the NuGet-package are located under lib\net45 (instead of lib\net452) and NuGet determines that it's ok to use them in .NET Framework 4.5.1 project. I don't know how (or if it's even possible) to force NuGet to use binaries targeted for framework 4.0 form example.
1) Create a new Console Application using .NET Framework 4.5.1
2) Install TaskScheduler NuGet-package version 2.5.17 (Install-Package TaskScheduler)
3) Add following line to Main-method:
using (var ts = new TaskService()) {}
4) Build the solution. Build fails on compiler error:
warning MSB3274: The primary reference "Microsoft.Win32.TaskScheduler, Version=2.5.17.0, Culture=neutral, PublicKeyToken=0d013ddd5178a2ae, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.1".
error CS0234: The type or namespace name 'TaskScheduler' does not exist in the namespace 'Microsoft.Win32' (are you missing an assembly reference?)
I suspect this is because the binaries in the NuGet-package are located under lib\net45 (instead of lib\net452) and NuGet determines that it's ok to use them in .NET Framework 4.5.1 project. I don't know how (or if it's even possible) to force NuGet to use binaries targeted for framework 4.0 form example.