NuGet Product(s) Affected
NuGet SDK
Current Behavior
NuGet.Build.Tasks.Pack.targets unconditionally sets PackageId to AssemblyName:
<PackageId Condition=" '$(PackageId)' == '' ">$(AssemblyName)</PackageId>
Now that (as of .NET 10 at least), these pack targets are imported from the SDK itself (and last), it's virtually impossible to get a project with NO PackageId. See https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.targets#L48-L54
Desired Behavior
Do not force a PackageId on every project, in particular if the project explicitly sets IsPackable=false.
Additional Context
No response
NuGet Product(s) Affected
NuGet SDK
Current Behavior
NuGet.Build.Tasks.Pack.targets unconditionally sets
PackageIdtoAssemblyName:Now that (as of .NET 10 at least), these pack targets are imported from the SDK itself (and last), it's virtually impossible to get a project with NO PackageId. See https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.targets#L48-L54
Desired Behavior
Do not force a PackageId on every project, in particular if the project explicitly sets IsPackable=false.
Additional Context
No response