Open benvillalobos opened 2 years ago
Issue is missing Type label, remember to add a Type label
I can repro this one, it looks exception is coming from below code: https://github.com/NuGet/NuGet.Client/blob/3ed642746f2609c6f586d096803630095b4add78/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs#L1181-L1185
Issue is missing Type label, remember to add a Type label
Team Triage: You can workaround the issue by specifying PackageId.
When determining a project name, NuGet uses the following in order of preference, PackageId, AssemblyName, MSBuildProjectName.
By setting PackageId, you'd prevent NuGet from having a.csproj have the name b
.
We've had a lot of these issues filled in the past, and as such as we should consider documenting it. https://github.com/NuGet/Home/issues?q=is%3Aissue+Ambiguous+project+name+is%3Aclosed.
Marking this as a docs issue.
Issue moved from dotnet/msbuild#8026
From @codingdave on Thursday, October 6, 2022 6:55:06 AM
Issue Description
I have an application that I want to brand by overwriting the AssemblyName. Now if the .exe gets the same name as a dll msbuild restore will fail with:
Steps to Reproduce
Unzip the sample dotnetrestore-issue.zip
Go into the directory of the sln
Execute dotnet restore: You will see that it works flawlessly
Now override the MsBuild property
BrandingAssemblyName
by the name of the dll (powershell: $env:BrandingAssemblyName="b")Again execute dotnet restore: You will see the error reported above
Expected Behavior
My usecase is that I want to extend my application
a.exe
with the functionality of a pluginb.dll
and brand the application asb.exe
.This will be the directory structure
So the binaries will not get in their way
Actual Behavior
The error mentioned above
Analysis
The MsBuild RestoreTask seems to not take into account the extension, just the assemblyname. So it believes there is an ambiguity of b.exe and b.dll but they are differentiable by extension.
Versions & Configurations
dotnet --version 6.0.401
I only use dotnet build from non-developer powershell. But for completeness this is the msbuild version extracted from the developer console from VS 2022 (Version 17.3.0) msbuild -version MSBuild version 17.3.0+f67e3d35e for .NET Framework 17.3.0.37102