Why there is no version 6.0.0 final of Microsoft.Win32.Registry nuget package? - package

The latest version of the Microsoft.Win32.Registry package is 6.0.0-preview.5.21301.5 released on 15th June 2021 and there is no .NET 7.0 preview version as well. However the Microsoft doc explains that the class Microsoft.Win32.Registry is available for .NET 6.0 and .NET 7.0 preview in the assembly Microsoft.Win32.Registry.dll.
The package System.Security.Principal.Windows has exactly the same versioning issue while the doc says that the class System.Security.Principal.WindowsPrincipal is available for .NET 6.0 and .NET 7.0 preview in the assembly System.Security.Principal.Windows.dll.
On the other hand the package System.Management for example is available for .NET 6.0 and .NET 7.0 preview.
What is happening with Microsoft.Win32.Registry and System.Security.Principal.Windows packages?

For Microsoft.Win32.Registry change your target framework to net6.0-windows - as answered in this discussion:
You shouldn't need an extra package. If you set <TargetFramework>net6.0-windows</TargetFramework> in your .csproj, you should get access to those types.

Related

Trouble using .net 7 preview on IIS

I installed .net 7 preview on Windows Server 2012 R2, but the installed version doesn't show in the list of runtimes.
dotnet --list-runtimes
Also running a test app on IIS didn't work. I get this message in the event-log:
Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '7.0.0-preview.7.22375.6' (x64) was not found.
- The following frameworks were found:
2.2.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
3.1.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
Is this issue fixable somehow?
I ended up installing the dotnet 7 rc1 sdk in addition to the runtime and it was recognized by
dotnet --list-runtimes
The web app in IIS recognized the runtime afterwards.

Codename one version 1.0 is installed even though I install version 6.0 from Eclipse Marketplace

I am using Eclipse 2020-06 (I have made a fresh install of Eclipse instead of upgrading it from an earlier version of Eclipse) and JDK 8 (1.8.0_261). My OS is Windows 10.
JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_261
When I download "Codename One" plugin from Eclipse Marketplace it shows the version as 6.0 and it says "Installed" at the end of the installation process.
However, when I go to "Help -> Eclipse IDE -> Installation Details" under Eclipse, CodenameOneFeature version is listed as: 1.0.0.201409151325
When I select CodenameOneFeature from this list and hit Update, it says "No updates found". So basically I cannot force it to update to 6.0.
I can confirm that I have the earlier version installed also from the setting of the Codename One projects I create: when I go to Properties -> Java Compiler, the compliance level is set to 1.5 (also 1.5 is used in build.xml file).
BTW, I have also tried installing Eclipse 2019-06 (instead of 2020-06) and/or installing JDK 10 (instead of JDK 8) and/or modifying the eclipse.ini (by adding -vm option) so that it uses the version of JDK I want (instead of setting JAVA_HOME). But no combination of those has solved the problem.
Updated answer:
I found the problem. I broke the update site with a commit a couple of weeks ago. This should be fixed in a couple of hours once server caches refresh.
Original answer:
With Eclipse at this time we only support JDK 8. We're experiencing issues in updating the eclipse plugin to the latest version. Once installed I think you can also use JDK 11 but it doesn't matter since we don't support JDK 11 features.
Once a reasonably new version of the plugin is installed you can press update in Codename One Settings and it will update our libraries to the latest version equivalent to the other IDEs.

Azure DevOps build: "sdk\2.1.515\ [...] not found. Check that a recent enough .NET Core SDK is installed or increase the version in global.json"

I get this error only in my Azure DevOps build task, and there is no explicit reference to SDK 2.1.515 anywhere in my solution (.NET Core 3.1 WPF). The "Visual Studio Version" in the build task is set to "Visual Studio 2019".
I also tried to generate a global.json with an explicit reference to the current SDK version (I found a hint here: how to setup SDK version into .Net core project when global.json is not enough?) but that didn't help.
The solution was:
On the pipeline's "Taks" tab, select "Pipeline, Build pipeline" (the light blue panel below the tab) and set the "Agent Specification" to "windows-2019".
Make sure the "Visual Studio Version" (in the build solution task) is set to "latest" or to "Visual Studio 2019".

VS2017 MSBuild autodetection takes MSBuild/v14 instead of v15 for WPF project

We are slowly migrating to VS2017 and most of the project do that silently without much interference. Today started migrating a WPF project from VS2015 to VS2017. When I build the solution I get the following warning:
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
I googled the problem but I seem to be alone out there. I have no clue what could cause this. The .Net target is 4.5.1 but changing that to 4.6.2 make no difference. Neither does clean or remove bin and obj directories. Who has got a clue?
I encountered this problem while building from the command line after migrating from VS2017 to VS2019 for a solution containing class libraries. I found I had VS2017's version of MSBuild in my PATH environment variable - C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin. Removing that path from the environment variable and re-opening my console solved the issue.
VS2017 MSBuild autodetection takes MSBuild/v14 instead of v15 for WPF project
You can try to update the version of nuget.exe to the 4.0 and above in the .nuget folder.
Visual Studio 2017 comes with NuGet 4.0 and NuGet 4.0 Package Manager Extension is currently not available for Visual Studio 2015 (Visual Studio 2015 comes with NuGet 3.4.4, and NuGet 3.5.0 is available as an explicit download for Visual Studio 2015 as well).
According to your comment, it seems the old nuget.exe not detect the MSBuild version 15.0, so please try to update the nuget.exe to 4.0 and above in the .nuegt folder.
Besides, I found your solution that is still configured by old package restore method "MSBuild-integrated restore", which is the original Package Restore implementation and though it continues to work in many scenarios, it does not cover the full set of scenarios addressed by the other two approaches.
Automatic Package Restore is the NuGet team's recommended approach to Package Restore within Visual Studio. You can convert to use the automatic package restore. Check the following thread for details:
Nuget: Switching from "Enable Package Restore" to "Automatic Package Restore"
Hope this helps.

Can't Install System.Net.Http Package into a Windows Phone 7.1 Silverlight Project

I used Nuget to install the "Microsoft ASP.NET Web API Client Libraries" to get the latest System.Net.Http assembly for use in Windows Phone 7.1 XNA and Silverlight projects. It installs just fine into my WP7.1 XNA projects, but doesn't allow me to install it into the WP7.1 Silverlight projects. I even tried installing it directly from the Package Manager Console into a newly created WP7.1 Silverlight project and got this Error response:
PM> Install-Package System.Net.Http
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.0.20710.0 && < 2.1)'.
You are downloading Microsoft.Net.Http from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/MVC_4_eula_ENU.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Net.Http 2.0.20710.0'.
You are downloading System.Net.Http from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/MVC_4_eula_ENU.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'System.Net.Http 2.0.20710.0'.
Successfully uninstalled 'Microsoft.Net.Http 2.0.20710.0'.
Install failed. Rolling back...
Install-Package : Could not install package 'Microsoft.Net.Http 2.0.20710.0'. You are trying to install this package into a project that targets 'Silverlight,Version=v4.0,Profile=WindowsPhone71', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:16
+ Install-Package <<<< System.Net.Http
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Is System.Net.Http compatible with WP7.1 Silverlight projects, and if so, how can I get it working?
Thanks
Dan Roth (the owner of the System.Net.Http Nuget package) responded via email: "System.Net.Http.dll is not support on XNA, Phone or Silverlight at this point. It is only support on .NET 4 (through ASP.NET Web API), .NET 4.5. and the .NETCore Profile in Windows 8." So that is the unfortunate answer to this question.
As was pointed out by Dan, the System.Net.Http NuGet package has been deprecated in favor of Microsoft.Net.Http. For the latter we shipped an update that allows targeting Windows Phone 7.1.
We're working on shipping a stable release but we don't have a date yet.
since this comes up 1st on google, the beta package now supports windows phone 7.1 projects
to install user package manager console
PM> Install-Package Microsoft.Net.Http -Pre
Click here for project home page

Resources