Skip to content

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Mar 11, 2021

At first, Android "Hello World" fails with:

> dotnet build -c Release
ILLink : error IL1009: Assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' reference 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' could not be resolved

Dropping the --skip-unresolved false switch passed to ILLink solves
this issue. This was a recommendation from Sven Boemer on the .NET team.

A nice, side-effect, is we no longer need workarounds like this any
longer:

<ItemGroup Condition=" '$(Configuration)' == 'Release' ">
  <PackageReference Include="System.CodeDom" Version="6.0.0-*" />
  <PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0-*" />
  <PackageReference Include="System.Diagnostics.PerformanceCounter" Version="6.0.0-*" />
  <PackageReference Include="System.Diagnostics.EventLog" Version="6.0.0-*" />
  <PackageReference Include="System.Drawing.Common" Version="6.0.0-*" />
  <PackageReference Include="System.IO.Ports" Version="6.0.0-*" />
  <PackageReference Include="System.Threading.AccessControl" Version="6.0.0-*" />
</ItemGroup>

I removed these from several tests.

BuildReleaseArm64 test, net6 apk size difference before/after

Simple XA:

-"PackageSize": 2885411
+"PackageSize": 2889606

XF/XA

-"PackageSize": 9886918
+"PackageSize": 8746124

The Xamarin.Forms app saw quite a bit of improvement, since we don't
have to bring in these @(PackageReference) anymore.

Other changes

I updated PerformanceTest to ignore NotSupportedException due to:

System.NotSupportedException : Unsupported log file format. Latest supported version is 10, the log file has version 11.

We need to use a new version of this package when it is available:

https://www.nuget.org/packages/MSBuild.StructuredLogger/2.1.303

@jonathanpeppers jonathanpeppers changed the title Bump to .NET 6.0.100-preview.2.21155.3 Bump to .NET 6.0.100-preview.3.21161.2 Mar 11, 2021
@jonathanpeppers jonathanpeppers changed the title Bump to .NET 6.0.100-preview.3.21161.2 Bump to .NET 6.0.100-preview.3.21161.23 Mar 11, 2021
@jonathanpeppers jonathanpeppers force-pushed the dotnet-preview.3.21161.23 branch 2 times, most recently from e0bb971 to ff18333 Compare March 12, 2021 02:29
@dotnet dotnet deleted a comment from azure-pipelines bot Mar 12, 2021
Changes: dotnet/installer@1a9103d...19e22a7

At first, Android "Hello World" fails with:

    > dotnet build -c Release
    ILLink : error IL1009: Assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' reference 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' could not be resolved

Dropping the `--skip-unresolved false` switch passed to ILLink solves
this issue. This was a recommendation from Sven Boemer on the .NET team.

A nice, side-effect, is we no longer need workarounds like this any
longer:

    <ItemGroup Condition=" '$(Configuration)' == 'Release' ">
      <PackageReference Include="System.CodeDom" Version="6.0.0-*" />
      <PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0-*" />
      <PackageReference Include="System.Diagnostics.PerformanceCounter" Version="6.0.0-*" />
      <PackageReference Include="System.Diagnostics.EventLog" Version="6.0.0-*" />
      <PackageReference Include="System.Drawing.Common" Version="6.0.0-*" />
      <PackageReference Include="System.IO.Ports" Version="6.0.0-*" />
      <PackageReference Include="System.Threading.AccessControl" Version="6.0.0-*" />
    </ItemGroup>

I removed these from several tests.

`BuildReleaseArm64` test, net6 apk size difference before/after

Simple XA:

  -"PackageSize": 2885411
  +"PackageSize": 2889606

XF/XA

  -"PackageSize": 9886918
  +"PackageSize": 8746124

The Xamarin.Forms app saw quite a bit of improvement, since we don't
have to bring in these `@(PackageReference)` anymore.

~~ Other changes ~~

I updated `PerformanceTest` to ignore `NotSupportedException` due to:

    System.NotSupportedException : Unsupported log file format. Latest supported version is 10, the log file has version 11.

We need to use a new version of this package when it is available:

https://www.nuget.org/packages/MSBuild.StructuredLogger/2.1.303
@jonathanpeppers jonathanpeppers force-pushed the dotnet-preview.3.21161.23 branch from ff18333 to 0331535 Compare March 12, 2021 14:42
Hopefully fixes runtime crash in .NET 6 Mono.Android-Tests:

    Can't find custom attr constructor image: Mono.Android.dll mtoken: 0x0a000464 due to:
    Could not resolve type with token 010000fb from typeref (expected class 'System.Runtime.CompilerServices.InternalsVisibleToAttribute' in assembly 'System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') assembly:System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e type:System.Runtime.CompilerServices.InternalsVisibleToAttribute member:(null)
@jonathanpeppers jonathanpeppers marked this pull request as ready for review March 15, 2021 01:30
<linker>
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Globalization.GlobalizationMode" />
<type fullname="System.Runtime.CompilerServices.InternalsVisibleToAttribute" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixed a crash in Mono.Android-Tests:

Can't find custom attr constructor image: Mono.Android.dll mtoken: 0x0a000464 due to:
Could not resolve type with token 010000fb from typeref (expected class 'System.Runtime.CompilerServices.InternalsVisibleToAttribute' in assembly 'System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') assembly:System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e type:System.Runtime.CompilerServices.InternalsVisibleToAttribute member:(null)

<!-- Please update DotNetRuntimePacksVersion below accordingly -->
<DotNetPreviewVersionBand Condition=" '$(DotNetPreviewVersionBand)' == '' ">6.0.100</DotNetPreviewVersionBand>
<DotNetPreviewVersionFull Condition=" '$(DotNetPreviewVersionFull)' == '' ">$(DotNetPreviewVersionBand)-preview.2.21155.3</DotNetPreviewVersionFull>
<DotNetPreviewVersionFull Condition=" '$(DotNetPreviewVersionFull)' == '' ">$(DotNetPreviewVersionBand)-preview.3.21161.23</DotNetPreviewVersionFull>
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI @rolfbjarne / @spouliot looks Android was able to bump to this version with just some minor changes.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we have a PR going here: dotnet/macios#10772, I was just waiting for P2 to go out first.

@jonathanpeppers jonathanpeppers merged commit 304e698 into dotnet:main Mar 15, 2021
@jonathanpeppers jonathanpeppers deleted the dotnet-preview.3.21161.23 branch March 15, 2021 19:44
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 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