When upgrading different beta versions of .NET MF 4.0 or doing final upgrade to RTM, one can experience problems in Vsual Studio during compilation. Typically this compilation error is shown:

Error 1 The "Microsoft.SPOT.Tasks.GetDeviceFrameworkPaths" task could not be loaded from 
the assembly Microsoft.SPOT.Tasks,Version=4.0..,Culture=neutral,PublicKeyToken=2670f5f21e7f4192. 
Could not load file or assembly 'Microsoft.SPOT.Tasks, Version=4.0, Culture=neutral, 
PublicKeyToken=2670f5f21e7f4192' or one of its dependencies. The system cannot find the file 
specified. Confirm that the  declaration is correct, and that the assembly and all 
its dependencies are available.	
C:\Program Files (x86)\MSBuild\Microsoft\.NET Micro Framework\v4.0\Device.targets	101	9


Error message points to C:\Program Files (x86)\MSBuild\Microsoft.NET Micro Framework\v4.0\Device.targets where everything seems to be fine. But Device.targets imoprts Tasks.settings from the same directory, which is very important. This files basicaly defines the name of TaskAssembly, which consists of two registry keys. And this is the problematic place. The necessary registry keys are sometimes not created or updated by the installation process (don’t know why).




To fix the problem, it’s necessary to change the registry value to proper its values. Specifically InstallRoot, BuildNumber, RevisionNumber. Following code snipet is .reg file that works for the .NET Micro Framework 4.0 SDK final version. In case of different version of the .NET MF, check the version value of C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.0\Tools\Microsoft.SPOT.Tasks.dll, to obtain proper BuildNumber and RevisionNumber.

32-bit system version

"InstallRoot"="C:\\Program Files\\Microsoft .NET Micro Framework\\v4.0\\"

64-bit system version

"InstallRoot"="C:\\Program Files (x86)\\Microsoft .NET Micro Framework\\v4.0\\"