I am using ASP.NET Core 5.0 since it came out a short while ago and I noticed something strange today. I crafted an installer for my software, which automatically filters out each .pdb file that slipped into my release build. A mechanism that never caused problems.
But the new .NET 5.0 runtime seems to have a problem with it, and IIS complained that it could not find the file runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.pdb.
I wondered why missing debug symbols would be an issue for a release build (or any build) and did some research. I found that the file in question was en entry in MyProject.deps.json
"Microsoft.Data.SqlClient.SNI.runtime/2.0.1": {
"runtimeTargets": {
"runtimes/win-arm/native/Microsoft.Data.SqlClient.SNI.dll": {
"rid": "win-arm",
"assetType": "native",
"fileVersion": "2.0.1.0"
},
"runtimes/win-arm/native/Microsoft.Data.SqlClient.SNI.pdb": {
"rid": "win-arm",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-arm64/native/Microsoft.Data.SqlClient.SNI.dll": {
"rid": "win-arm64",
"assetType": "native",
"fileVersion": "2.0.1.0"
},
"runtimes/win-arm64/native/Microsoft.Data.SqlClient.SNI.pdb": {
"rid": "win-arm64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll": {
"rid": "win-x64",
"assetType": "native",
"fileVersion": "2.0.1.0"
},
"runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.pdb": {
"rid": "win-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll": {
"rid": "win-x86",
"assetType": "native",
"fileVersion": "2.0.1.0"
},
"runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.pdb": {
"rid": "win-x86",
"assetType": "native",
"fileVersion": "0.0.0.0"
}
}
},
As you can see, there are 4 .pdb files in there. I tried deleting the one entry that caused the problem, and boom... everything works fine by now. Just adding the .pdb file to the folder also did the trick. So I already solved the practical problem by myself.
My question is: Can I safely delete those entrys from the .deps.json, or might that cause problems? Could this be an error by Microsoft? Did those entrys slip in there by accident?