Description
When you publish a project that references version 8.0.12 of the Microsoft.Windows.Compatibility NuGet, it includes three DLLs (System.Data.SqlClient.dll, System.Diagnostics.EventLog.Messages.dll, and System.ServiceModel.dll) which no longer have debug symbols available on the Microsoft symbol server (https://msdl.microsoft.com/download/symbols). The latest 8.0.* version should only reference DLLs with debug symbols available.
To reproduce this:
- Create PublishNet8.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.12" />
</ItemGroup>
</Project>
- Create Program.cs:
class Program
{
static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
- Publish the project using this command line:
dotnet publish PublishNet8.csproj --self-contained -r win-x64
- Install the debugging tools for Windows so you can use symchk.exe to download symbols. (https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/using-symchk)
- Run these commands while in the "bin\Release\net8.0\win-x64\publish" folder:
symchk.exe /s SRV*https://msdl.microsoft.com/download/symbols /if System.Data.SqlClient.dll /oc . /v
symchk.exe /s SRV*https://msdl.microsoft.com/download/symbols /if System.Diagnostics.EventLog.Messages.dll /oc . /v
symchk.exe /s SRV*https://msdl.microsoft.com/download/symbols /if System.ServiceModel.dll /oc . /v
These three binaries have missing symbols on the symbol server, so this command will fail to find their symbols.
System.Data.SqlClient.dll is in the System.Data.SqlClient NuGet. It could be upgraded from 4.8.6 to 4.9.0. I verified that version 4.9.0 has symbols available.
System.Diagnostics.EventLog.Messages.dll is in the System.Diagnostics.EventLog NuGet. The PDB for System.Diagnostics.EventLog.Messages.dll is missing even for the latest version of this NuGet (9.0.1), so this needs to be fixed at the source of that NuGet.
System.ServiceModel.dll is in the System.ServiceModel.Primitives NuGet. The latest version of this NuGet (8.1.1) no longer includes System.ServiceModel.dll, so upgrading would avoid the issue of referencing a DLL without symbols.