Myget server show Nuget package license as UnKnown - nuget

I followed the instructions of nuget license here.
I use the following code in myproject.csproj:
<PropertyGroup>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\LICENSE.md" Pack="true" PackagePath=""/>
</ItemGroup>
The Nuget package is built correctly.
No build error or warning related to license.
The license file is included in the package correctly.
When I Inspect the nuspec file in the package, I find this xml code:
<license type="file">LICENSE.md</license>
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
In MyGet feed package, it show package license as UnKnown and point to: 'https://aka.ms/deprecateLicenseUrl'.
My Question:
Why the nuspec file included in the package show deprecateLicenseUrl?
What I missed to show license in MyGet correctly?

Why the nuspec file included in the package show deprecateLicenseUrl?
Embedded licenses were added to the NuGet client in NuGet 4.9, which corresponds to Visual Studio 2017 15.9, around November 2018. Before then, only license URLs were supported. This means that Visual Studio 2017 15.8 and earlier, as well as Visual Studio 2015 and earlier do not support embedded licenses, and so the license URL pointing to the documentation is added so that they show something, allowing customers to understand why they can't see the real license and instructions on how to find the actual license for the package. Similarly, it means that NuGet feeds need to change to support embedded licenes. The NuGet client team worked with the nuget.org team to make sure they both supported it at the same time, but the NuGet team has no direct influence of other NuGet feed implementations. If MyGet has not updated to support embedded licenses, it can use the lincense url backwards compatibility aimed at users of old versions of Visual Studio.
What I missed to show license in MyGet correctly?
You could use both embedded license and a custom license URL, but then NuGet will generate warnings when you pack, and your package may be rejected if you try to pubilsh to nuget.org. Otherwise you haven't missed anything, it just sounds like MyGet hasn't "kept up" with changes to NuGet.

Related

#postsharp Unable to compile after adding PostSharp.Community nuget package (on a Mac)

I'm using a Mac with Visual Studio 2019. I've added nuget packages: PostSharp and PostSharp.Community. I have NOT changed any code. I wasn't NOT prompted to select a license. I'm simply trying to compile, and I get the following errors.
/var/tmp/postsharp/cache/DependencyRestore/6.0.101/net6.0-sdk6.0.101-osx-x64--ps6.10.6.0-cf0d89f.deps.proj
: error NU3034: Package 'System.ValueTuple 4.4.0' from source
'https://api.nuget.org/v3/index.json': This package is signed but not
by a trusted signer.
/var/tmp/postsharp/cache/DependencyRestore/6.0.101/net6.0-sdk6.0.101-osx-x64--ps6.10.6.0-cf0d89f.deps.proj
: error NU3037: Package 'System.Security.Cryptography.ProtectedData
4.4.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired.
My project is targeting framework NetCore3.1. I don't know why PostSharp mentions net6.0.
As soon as I remove the PostSharp packages, it compiles fine.
Any help, would be greatly appreciated.
Thanks,
Jason
You probably have .NET 6.0 SDK installed on the machine and it is the active SDK (the highest version is usually used by default). PostSharp always executes under the runtime associated with the current SDK.
You should use the global.json file to specify SDK for .NET Core 3.1. This would cause PostSharp to run on .NET Core 3.1.
If this does not help, it means that PostSharp's dependency packages cannot be installed from nuget.org.
You can disable PostSharp's dependency restore by setting DependencyRestoreDisabled=True (either as env var or MSBuild property) and make sure that the project that was generated into /var/tmp/postsharp/cache/DependencyRestore/<SdkVersion>/<id>.proj has all it's dependencies present in the \var\tmp\postsharp\NuGetFallback directory.
Disabling the dependency restore disables automated checks and presumes that PostSharp can find all its dependencies on the machine.
I added the global.json, removed SDK 6.x. Set PostSharpDependencyRestoreDisabled=True and then I had to manually add all the referenced Nuget packages. It was annoying, but at least it works now.
Daniel, wetween both your responses, I was able to get it fixed!
Thanks!

Differences between Code OSS and Visual Studio Code

As developers stated here,
The cool thing about all of this is that you have the choice to use the Visual Studio Code branded product under our license or you can build a version of the tool straight from the vscode repository, under the MIT license.
Here's how it works. When you build from the vscode repository, you can configure the resulting tool by customizing the product.json file. This file controls things like the Gallery endpoints, “Send-a-Smile” endpoints, telemetry endpoints, logos, names, and more.
When we build Visual Studio Code, we do exactly this. We clone the vscode repository, we lay down a customized product.json that has Microsoft specific functionality (telemetry, gallery, logo, etc.), and then produce a build that we release under our license.
Given that I'm not able to build from source by myself, if I install VSC and replace product.json with the clean version, will I have the same effect?
Shortly:
Code - OSS is an open source project without any proprietary code.
Visual Studio Code is a distribution of the Code - OSS repository with Microsoft specific customizations released under a traditional Microsoft product license.
Also you can find more information here

proget add package from nuget.org

I would like to add a few packages to proget from nuget.org.
For example I am trying to add NLog but get an error:
The package could not be installed.
The package was not found in the remote repository.
It seems to work if I download the packages to disk first and then upload them.
Same problem here. This seems specific to NLog though, as I can install other packages just fine (e.g. log4net, nlog.config). I used https://www.nuget.org/api/v2 as the feed though (slightly different from yours #Damian). I've reported it to the ProGet support team, let's see.

Microsoft OPEN XML sdk 2.5 on NUGET

When Installing the documentFormat.OpenXML from nuget, why does it say UNOFFICIAL packaging of Microsoft's OpenXML sdk 2.5 even though its created by Microsoft? if its Unofficial, is there an Official version?
It is unofficial because the DocumentFormat.OpenXml NuGet package was not created by Microsoft.
Whilst the Authors says Microsoft, that is just a text field that can contain anything. The owner is the more important piece of information and that is not Microsoft. NuGet packages created and owned by Microsoft typically have Microsoft as the owner:
https://www.nuget.org/profiles/microsoft
There is also a curated NuGet package feed of Microsoft NuGet packages and those that Microsoft officially support:
https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/
There is no official Microsoft NuGet package for OpenXml currently.

Troubleshooting PostSharp license issue on build server: Where can I find my license for PostSharp Express?

I am experiencing issues with my CI build server in which PostSharp is causing the build to fail with the message: The assembly 'yada-yada.dll' uses non-licensed features (Basic Features). [...]. We are using the current version of PostSharp (3.1.52) and have no troubles with the library in local development environment where developers have a registered Express license.
According to PostSharp docs, the build server should not need a license. However, they acknowledge that the automation identification could fail:
If this check does not work for any reason, you may use the license key of any licensed user for the build server. This will not be considered a license infringement. However, it is better to report the issue to our technical support so that we can fix the detection algorithms.
It is recommended to include the license key in the source control.
I'm attempting to test this theory but I can't seem to get access to my actual PostSharp Express license! The PostSharp Options aren't any help either:
Anyone have any ideas? Thanks!
You can find your license key under the registry key HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3.
If your license key does not appear at the location specified, these steps will help you find a new one....
Uninstall any previous version of postsharp installed in visual studio by going to TOOLS > Extensions & Updates.
Open regedit. Delete the following registry key (including all child keys):
HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3
Download the latest postsharp vs extension. At time of writing I used 4.2.17. Also make sure you are using the latest postsharp nuget package.
Begin the install & follow the steps. When selecting which kind of license you want, choose the Express User License (the last option).
Enter your details, then on the penultimate step, do not tick the box to register postsharp for all accounts on this machine.
Complete the installation, you should then find the license key in your registry under:
HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3\LicenseKey
There are two types of keys!
for current user: HKCU\SOFTWARE\SharpCrafters\PostSharp 3
for all users: HKLM\SOFTWARE\WOW6432Node\SharpCrafters\PostSharp 3
The license might be in one of them depending on what license type you chose.