NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): NuGet.exe, dotnet restore and Visual Studio
NuGet version (x.x.x.xxx): 5.3.0.6260
dotnet.exe --version (if appropriate): 3.0.100
VS version (if appropriate): 16.3.1
OS version (i.e. win10 v1607 (14393.321)): Win10 v1903 (18362.356) and Linux Docker container (sdk:3.0-alpine)
Worked before? If so, with which NuGet version: first try at this
dotnet nuget locals all --clear
or build inside DockerPackages are actually restored successfully, only these warnings show up with every restore/build commands and I haven't found any way to suppress it.
Detailed logs from Docker build of attached project
docker-build-output.log
Issue repro. You need to update nuget.config with GitHub PAT that can download packages.
nuget-restore-issue-repro.zip
I have the EXACT same issue. It's a shame to see it's been nearly 2 months and no response, at all :(
I have the same issues as well.
Bump
The issue is still present.
Got the same Problem, ist there a way to supress this warnings?
This is a bug in GPR. When NuGet makes a call to the GPR server to fetch a non-existent package, it properly returns HTTP-404, just like nuget.org does. However, unlike nuget.org, it also adds a X-Nuget-Warning
header on the response containing the exact warning message you're seeing (example: X-Nuget-Warning: NAME_UNKNOWN:Package with name 'coverlet.msbuild' was not found in the package source 'organizationName'
). GPR is misusing that header -- according to https://github.com/NuGet/Home/wiki/%5BSpec%5D-Server-side-warnings-for-NuGet-client it should be used just for warnings and errors, which this isn't.
Solution is for the GPR devs to stop sending that header in their 404 response.
I've brought this up with GitHub and they have an internal issue open with their engineering team tracking this bug. No ETA yet.
You might suppress these warnings by setting MSBuild properties HideWarningsAndErrors
as true and EmitAssetsLogMessages
as false until it is fixed.
Can you provide an example how to configure that? And does it disable ALL warning, include others than NuGet ones?
You can just put these elements in your .csproj
file like this:
<PropertyGroup>
<HideWarningsAndErrors>true</HideWarningsAndErrors>
<EmitAssetsLogMessages>false</EmitAssetsLogMessages>
</PropertyGroup>
or pass CLI argument like dotnet build -p:HideWarningsAndErrors=true -p:EmitAssetsLogMessages=false
You can confirm it by inspecting the output of dotnet build PROJECT -pp:out.xml
. HideWarningsAndErrors
is only used in the Restore
target, and EmitAssetsLogMessage
is only used in RunResolvePackageDependencies
and ReportAssetsLogMessages
targets. It is not used outside.
I've brought this up with GitHub and they have an internal issue open with their engineering team tracking this bug. No ETA yet.
Any one have word on this? Seems like something that would be simple for GPR to fix, but 20+ days later, still an issue.
Still relevant, and annoying.
I have the same Issue, it is still present.
Comon. Gitlab just released nuget package support, stop me from going there.....
Doing what @foriequal0 suggested and that worked. So dotnet publish "Foo.sln" -c Release -p:HideWarningsAndErrors=true -p:EmitAssetsLogMessages=false -o out
Same issue
also same here
Another workaround, which does not potentially hide relevant warnings/errors:
dotnet build
(or possibly just dotnet restore
)This has now been fixed at the GitHub Packages end!
Build before the fix was deployed:
...buld after:
Looks like it's working! 馃帀
@jirikopecky could you confirm and close this issue if you agree? 馃檹
I have forwarded the issue to GitHub folks. But I also see it seems to have been fixed. @jirikopecky can you confirm if your issue has been fixed?
Hello, I am currently out of office. I will be able to verify it in the week of 11th May
Hello, I can confirm that the issue have been fixed. Thanks for your help!
Most helpful comment
Bump