Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xabuild] update binding redirects for MSBuild 17.3 #7273

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

jonathanpeppers
Copy link
Member

xabuild Xamarin.Android-Tests.sln was failing with:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Microsoft.Build.Shared.FileUtilities.LooksLikeUnixFilePath(String value, String baseDirectory)
at Microsoft.Build.CommandLine.MSBuildApp.GatherCommandLineSwitches(List`1 commandLineArgs, CommandLineSwitches commandLineSwitches, String commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.GatherAllSwitches(String commandLine, CommandLineSwitches& switchesFromAutoResponseFile, CommandLineSwitches& switchesNotFromAutoResponseFile)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

This appears to be happening on Windows build machines running VS 2022
17.3 and MSBuild 17.3.

I did an audit comparing xabuild's App.config file with:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe.config

We needed to update specifically to:

  • System.Memory 4.5.5
  • System.Collections.Immutable 6.0.0
  • System.Runtime.CompilerServices.Unsafe 6.0.0

Note that in some cases the NuGet package version doesn't match the
assembly version.

After these changes, I can build xabuild locally with MSBuild 17.3,
and then also build Xamarin.Android projects.

@jonathanpeppers jonathanpeppers changed the title [build] update binding redirects for MSBuild 17.3 [xabuild] update binding redirects for MSBuild 17.3 Aug 17, 2022
@jonathanpeppers jonathanpeppers marked this pull request as ready for review August 17, 2022 13:37
@jonathanpeppers jonathanpeppers marked this pull request as draft August 17, 2022 13:38
`xabuild Xamarin.Android-Tests.sln` was failing with:

    MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
    System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    File name: 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
    at Microsoft.Build.Shared.FileUtilities.LooksLikeUnixFilePath(String value, String baseDirectory)
    at Microsoft.Build.CommandLine.MSBuildApp.GatherCommandLineSwitches(List`1 commandLineArgs, CommandLineSwitches commandLineSwitches, String commandLine)
    at Microsoft.Build.CommandLine.MSBuildApp.GatherAllSwitches(String commandLine, CommandLineSwitches& switchesFromAutoResponseFile, CommandLineSwitches& switchesNotFromAutoResponseFile)
    at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

This appears to be happening on Windows build machines running VS 2022
17.3 and MSBuild 17.3.

I did an audit comparing xabuild's `App.config` file with:

    C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe.config

We needed to update specifically to:

* System.Memory 4.5.5
* System.Collections.Immutable 6.0.0
* System.Runtime.CompilerServices.Unsafe 6.0.0

Note that in some cases the NuGet package version doesn't match the
assembly version.

After these changes, I can build `xabuild` locally with MSBuild 17.3,
and then also build Xamarin.Android projects.
@jonathanpeppers
Copy link
Member Author

This is looking good, this step was failing before:

image

@jonathanpeppers jonathanpeppers marked this pull request as ready for review August 17, 2022 20:36
@jonpryor jonpryor merged commit 4873dfa into dotnet:main Aug 17, 2022
@jonathanpeppers jonathanpeppers deleted the xabuild-binding-redirects branch August 17, 2022 20:48
jonathanpeppers added a commit that referenced this pull request Aug 17, 2022
`xabuild Xamarin.Android-Tests.sln` was failing with:

	MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
	System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
	File name: 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
	   at Microsoft.Build.Shared.FileUtilities.LooksLikeUnixFilePath(String value, String baseDirectory)
	   at Microsoft.Build.CommandLine.MSBuildApp.GatherCommandLineSwitches(List`1 commandLineArgs, CommandLineSwitches commandLineSwitches, String commandLine)
	   at Microsoft.Build.CommandLine.MSBuildApp.GatherAllSwitches(String commandLine, CommandLineSwitches& switchesFromAutoResponseFile, CommandLineSwitches& switchesNotFromAutoResponseFile)
	   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

This appears to be happening on Windows build machines running
Visual Studio 2022 17.3 and MSBuild 17.3.

I did an audit comparing xabuild's `App.config` file with:

	C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe.config

We needed to update specifically to:

  * System.Memory 4.5.5
  * System.Collections.Immutable 6.0.0
  * System.Runtime.CompilerServices.Unsafe 6.0.0

Note that in some cases the NuGet package version doesn't match the
assembly version.

After these changes, I can build `xabuild` locally with MSBuild 17.3,
and then also build Xamarin.Android projects.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants