I am using Visual Studio 2022, in a C# project, trying to resolve a assembly name/version mismatch issue.
I've read though this thread, which was a bit helpful: Strange issue with System.Net.Http 4.2.0.0 not found
But despite installing the latest System.Net.Http
through NuGet, I am still unable to add System.Net.Http.WebRequestHandler
from 4.2.0.0. It would only reference the 4.0.0.0 version.
When I try to build my installer, it is throwing these warnings, 1) they are being "under Windows System File Protection" and 2) it is bundling 2 of those System.Net.Http.dll
with the 2 different versions mentioned above.
WARNING: 'System.IO.Compression.FileSystem.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IO.Compression.FileSystem\v4.0_4.0.0.0__b77a5c561934e089\System.IO.Compression.FileSystem.dll' is under Windows System File Protection.
WARNING: 'System.IO.Compression.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IO.Compression\v4.0_4.0.0.0__b77a5c561934e089\System.IO.Compression.dll' is under Windows System File Protection.
WARNING: 'System.Net.Http.WebRequest.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.WebRequest\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.WebRequest.dll' is under Windows System File Protection.
WARNING: 'System.Diagnostics.Tracing.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Tracing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Tracing.dll' is under Windows System File Protection.
WARNING: 'System.Net.Http.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll' is under Windows System File Protection.
So my questions are:
- How do you get Visual Studio 2022 to properly install and/or set those assembly version?
- How do you get around those "under Windows System File Protection" warnings?
When I run Analyze Assembly Dependencies, I am getting this conflict, 2 different DLLs with the same name but different versions:
I have these components installed:
Edit: Is there a way to force/change the default version of the assembly? It only shows 4.2.0.0
.