Skip to content

Instantly share code, notes, and snippets.

@crnastena
Last active October 5, 2018 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crnastena/ef555b346b6b28f97865cf1a10b587f2 to your computer and use it in GitHub Desktop.
Save crnastena/ef555b346b6b28f97865cf1a10b587f2 to your computer and use it in GitHub Desktop.
Regex to convert Visual Studio build suggestions "Consider app.config remapping of assembly" to dependentAssembly configuration records in order to "to solve conflict and get rid of warning"
56> Consider app.config remapping of assembly "System.Runtime.InteropServices.RuntimeInformation, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "0.0.0.0" [] to Version "4.0.2.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net462\lib\System.Runtime.InteropServices.RuntimeInformation.dll] to solve conflict and get rid of warning.
56> Consider app.config remapping of assembly "System.Collections.Concurrent, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Collections.Concurrent.dll] to Version "4.0.11.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.Concurrent.dll] to solve conflict and get rid of warning.
56> Consider app.config remapping of assembly "System.Collections, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Collections.dll] to Version "4.0.11.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.dll] to solve conflict and get rid of warning.
Find Regex:
.* assembly "([A-Za-z.]*), Culture=neutral, PublicKeyToken=([a-z0-9]*)".*to Version "([0-9.]*)" .*\n
Replace Regex:
<dependentAssembly>
<assemblyIdentity name="$1" culture="neutral" publicKeyToken="$2" />
<bindingRedirect oldVersion="0.0.0.0-$3" newVersion="$3" />
</dependentAssembly>\n
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Concurrent" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment