.NET NuGet Certificate Validation Errors (NU3037/NU3038) When Building WPF Projects Under Wine

Questions about Wine on Linux
Post Reply
damirlisak
Newbie
Newbie
Posts: 1
Joined: Sun Jun 15, 2025 12:58 am

.NET NuGet Certificate Validation Errors (NU3037/NU3038) When Building WPF Projects Under Wine

Post by damirlisak »

Hello Wine Community,
I'm experiencing certificate validation issues when building .NET WPF projects under Wine, and I'm hoping someone has encountered and solved this problem or that the Wine team can provide guidance.
Problem Description:
When building .NET 8/9 WPF projects using wine dotnet build, I consistently get the following NuGet errors:

NU3037: Package signature is invalid or cannot be verified
NU3038: Package signature validation failed

Environment:

Wine version: [your version]
.NET SDK: 9.0.107, 8.0.117, 7.0.410 (installed under Wine)
Host OS: Linux
Project type: WPF (.NET 8 with <UseWPF>true</UseWPF>)

Context:
I'm using Wine specifically because WPF compilation requires Windows-specific build tasks that don't work on Linux. The same projects compile successfully on native Windows.
Root Cause Analysis:
Based on the GitHub issue https://github.com/NuGet/Home/issues/13252, this appears to be related to .NET's enhanced certificate validation introduced in recent versions. The validation seems to fail under Wine's crypto implementation.
What I've Tried:

Various NuGet configuration options (signatureValidationMode=accept, etc.)
MSBuild properties to disable validation (EnableNuGetPackageAudit=false)
Environment variables and registry modifications
Clearing all NuGet caches and rebuilding
Copying NuGet DLLs from .NET 7 (which doesn't have this validation) to .NET 8/9

Questions:

Has anyone successfully worked around NuGet certificate validation issues under Wine?
Are there Wine-specific registry settings or DLL overrides that could help?
Could this be addressed in Wine's crypto/certificate handling implementation?

Technical Details:
The issue seems to stem from System.Security.Cryptography.Pkcs.dll and related certificate validation components not working correctly under Wine's Windows API emulation.
Any insights or workarounds would be greatly appreciated. This affects anyone trying to build modern .NET WPF applications in cross-platform environments.
Thanks in advance!
qwertymnb
Level 5
Level 5
Posts: 273
Joined: Sun Jan 17, 2016 4:36 pm

Re: .NET NuGet Certificate Validation Errors (NU3037/NU3038) When Building WPF Projects Under Wine

Post by qwertymnb »

Hi,

Could you provide exact instructions how to reprocude this error?
(I'm encountering a bug that looks more or less similar in another app, but which is quite difficult to reproduce. If it's easy to reproduce I'll open a bugreport for it.) Thanks in advance.
Post Reply