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

[msbuild] Don't ship the same Xamarin.Localization.MSBuild.dll for both Xamarin.iOS and Xamarin.Mac #9830

Closed
rolfbjarne opened this issue Oct 9, 2020 · 1 comment
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS macOS Issues affecting macOS msbuild Issues affecting our msbuild tasks/targets regression The issue or pull request is a regression
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Oct 9, 2020

We ship Xamarin.Localization.MSBuild.dll for both Xamarin.iOS and Xamarin.Mac, but this turns out problematic when users have different versions of Xamarin.iOS and Xamarin.Mac installed, and they have a solution with both Xamarin.Mac and Xamarin.iOS projects, because which Xamarin.Localization.MSBuild.dll is loaded is random, and might be out of date with the other one, ending up with errors like this:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets(451,3): error MSB4018: Unerwarteter Fehler bei der DetectSdkLocations-Aufgabe.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets(451,3): error MSB4018: System.MissingMethodException: Method not found: string Xamarin.Localization.MSBuild.MSBStrings.get_E0083()
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets(451,3): error MSB4018:   at Xamarin.Mac.Tasks.DetectSdkLocationsTaskBase.Execute () [0x0000b] in <d017cb344f634ca38ded1ddbdf8b14c4>:0 
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets(451,3): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:575 
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets(451,3): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002a9] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:818 

Potential solutions:

  • Use ILRepack to merge Xamarin.Localization.MSBuild.dll into the main iOS/Mac MSBuild assembly (this is what we already do for other assemblies, but due to resource loading this might not work).
  • Rename Xamarin.Localization.MSBuild.dll to Xamarin.[iOS|Mac].Localization.MSBuild.dll (this might require having two different projects).
  • Sign each version with different keys? Not sure if this would work, but it might be the simplest.

Originally posted by @tipa in https://github.com/xamarin/xamarin-macios/issue_comments/705712527

@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS macOS Issues affecting macOS msbuild Issues affecting our msbuild tasks/targets labels Oct 9, 2020
@rolfbjarne rolfbjarne added this to the Future milestone Oct 9, 2020
@rolfbjarne rolfbjarne added the regression The issue or pull request is a regression label Oct 9, 2020
@rolfbjarne
Copy link
Member Author

This was fixed by versioning Xamarin.Localization.MSBuild: 7b559b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS macOS Issues affecting macOS msbuild Issues affecting our msbuild tasks/targets regression The issue or pull request is a regression
Projects
None yet
Development

No branches or pull requests

1 participant