Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update more NuGet package versions
*Windows* smoke tests crash ~instantly:

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6930346&view=ms.vss-test-web.build-test-results-tab&runId=60074246&resultId=100047&paneView=debug

```
System.TypeInitializationException : The type initializer for 'Xamarin.ProjectTools.XamarinAndroidCommonProject' threw an exception.
----> System.TypeInitializationException : The type initializer for 'SixLabors.ImageSharp.Configuration' threw an exception.
----> System.IO.FileLoadException : Could not load file or assembly 'System.Memory, Version=4.0.1.1, 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)
   at Xamarin.ProjectTools.XamarinAndroidCommonProject..ctor(String debugConfigurationName, String releaseConfigurationName)
   at Xamarin.ProjectTools.XamarinAndroidApplicationProject..ctor(String debugConfigurationName, String releaseConfigurationName, String packageName) in C:\a\_work\1\s\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Android\XamarinAndroidApplicationProject.cs:line 41
   at Xamarin.Android.Build.Tests.PackagingTest.CheckSignApk(Boolean useApkSigner, Boolean perAbiApk) in C:\a\_work\1\s\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\PackagingTest.cs:line 381
--TypeInitializationException
   at SixLabors.ImageSharp.Image.Load(Stream stream, IImageFormat& format)
   at Xamarin.ProjectTools.XamarinAndroidCommonProject..cctor() in C:\a\_work\1\s\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Android\XamarinAndroidCommonProject.cs:line 40
--FileLoadException
   at SixLabors.ImageSharp.Configuration..ctor(IConfigurationModule[] configurationModules)
   at SixLabors.ImageSharp.Configuration.CreateDefaultInstance()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at SixLabors.ImageSharp.Configuration..cctor()
```

Not sure what exactly broke it, but we need to try to fix it.

Complicating the "fix" side of things, I can't build `xabuild.exe`
on Windows right now, so I'm flying blind here.

Update System.Collections.Immutable to 7.0.0 (latest; why not?).

Update SixLabors.ImageSharp to 2.1.3.

I hope this is the actual fix, because `SixLabors.ImageSharp.dll`
v2.1.3 no longer *references* `System.Memory.dll`, so failure to
find the assembly should be fine!  (Right?  Right?!)
  • Loading branch information
jonpryor committed Nov 9, 2022
commit 24d5280091bdee84f15249c28431d68833c8fbb2
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<NuGetApiPackageVersion>5.4.0</NuGetApiPackageVersion>
<LZ4PackageVersion>1.1.11</LZ4PackageVersion>
<MonoOptionsVersion>6.12.0.148</MonoOptionsVersion>
<SystemCollectionsImmutableVersion>6.0.0</SystemCollectionsImmutableVersion>
<SystemCollectionsImmutableVersion>7.0.0</SystemCollectionsImmutableVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<ELFSharpVersion>2.13.1</ELFSharpVersion>
<MdocPackageVersion Condition=" '$(MdocPackageVersion)' == '' ">5.8.9.2</MdocPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe don't update SixLabors.ImageSharp, as they depend on an older System.Memory?

https://www.nuget.org/packages/SixLabors.ImageSharp/2.1.3#dependencies-body-tab

I also heard that package is dropping out of the .NET foundation -- so I'm not sure if the license is going to change on newer versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the 3rd commit in this PR which updated SixLabors.ImageSharp. We had similar errors about System.Memory before updating this package; this package was updated to attempt to fix those errors. See 24d5280.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the ImageSharp error...

It seems like the only way to fix is to add an assembly binding redirect to nunit3-console.exe.config. Which feels really weird...

Maybe it would be better to remove ImageSharp and use something else? Do we just use it in a test?

<PackageReference Include="Microsoft.Win32.Registry" />
<ProjectReference Include="..\..\..\..\external\xamarin-android-tools\src\Xamarin.Android.Tools.AndroidSdk\Xamarin.Android.Tools.AndroidSdk.csproj">
<Project>{E34BCFA0-CAA4-412C-AA1C-75DB8D67D157}</Project>
Expand Down
2 changes: 1 addition & 1 deletion tools/xabuild/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="6.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="7.0.0.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating this file is tricky, I usually look at entries in:

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

VS 2022 17.4 says:

<dependentAssembly>
  <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this because I updated the System.Collections.Immutable NuGet package version, which i suppose I shouldn't do.

</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down