this question is related to my other stackoverflow issue.
Can anybody please tell me what Microsoft.NET.Build.Extensions is and why msbuild sometimes takes references from it instead of /packages folder?
Problem description:
I have C# application (targeting .NET Framework 4.6.2). I am using some nuget references (e.g. Microsoft.DotNet.PlatformAbstractions.2.1.0) which is dependent on System.Runtime.InteropServices.RuntimeInformation(v4.3.0). Nuget downloaded this .dll to my /packages folder with file version 4.6.24705.1. During build process this .dll is overriden by higher version 4.6.26011.1 from location "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net462\lib\System.Runtime.InteropServices.RuntimeInformation.dll"
Everything works fine except my build machine msbuild folder does not contain Microsoft.NET.Build.Extensions and although build process is finished successfuly the result build is not going to run due to this lib which is copied this time from packages with lower version 4.6.24705.1. It says "Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation ..."
EDIT: 29.6.2022
So "MSBuild\Microsoft\Microsoft.NET.Build.Extensions" folder is apparently created by installing .NET SDK to Visual Studio Build Tools 2019 via Visual Studio Installer.
After I installed .NET SDK the build process starts to mind this folder and some of my System packages are "overidden" during the build process. Maybe it has something to do with .netstandard? Can somebody explain how does the build process works in this situation?