Skip to content

AssemblyLoadContext issue with satellite assemblies on Browser #39379

Closed
mono/mono
#20308

Description

@akoeplinger

The tests System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly and System.Runtime.Loader.Tests.GetAssemblyNameTest_ValidAssembly can't load satellite assemblies for some reason, we should investigate.

Activity

  1. added this to the 5.0.0 milestone on Jul 15, 2020
  2. steveisok commented on Jul 23, 2020

    @steveisok
    Member

    @akoeplinger was this before or after enabling ICU?

  3. akoeplinger commented on Jul 24, 2020

    @akoeplinger
    MemberAuthor

    Since I opened this 9 days ago and ICU was merged 8 days ago probably before :)

    I tried reenabling the tests but they still failed.

  4. safern commented on Jul 24, 2020

    @safern
    Member

    I'm looking at this.

    For: System.Runtime.Loader.Tests.GetAssemblyNameTest_ValidAssembly we can add System.Runtime.Loader.Tests.dll to the VFS until we have ALC support to load by name from the bundle.

    For: System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly still investigating.

  5. safern commented on Jul 25, 2020

    @safern
    Member

    So looking a little bit deeper on the SatelliteAssembly case. It seems like the satellite assemblies are not in the bundle, they're in the VFS. For example this is an entry of the mono-config:

        {
          "virtual_path": "en/System.Runtime.Loader.Tests.resources.dll",
          "behavior": "vfs",
          "name": "supportFiles/13_System.Runtime.Loader.Tests.resources.dll"
        },

    However, when we try to find the assembly in the bundle here:

    if (strcmp (bundles [i]->name, is_satellite ? filename : name) == 0) {

    We never find the matching name... this is what we have in the bundle:

    *** ENTERED mono_assembly_open_from_bundle
    *** lowercase_filename=system.runtime.loader.tests.resources.dll
    *** PROBING against xunit.runner.utility.netcoreapp10.dll
    *** PROBING against xunit.execution.dotnet.dll
    *** PROBING against xunit.core.dll
    *** PROBING against xunit.assert.dll
    *** PROBING against xunit.abstractions.dll
    *** PROBING against WasmTestRunner.dll
    *** PROBING against TestUtilities.dll
    *** PROBING against System.Xml.XPath.XDocument.dll
    *** PROBING against System.Xml.XPath.dll
    *** PROBING against System.Xml.XmlSerializer.dll
    *** PROBING against System.Xml.XDocument.dll
    *** PROBING against System.Xml.ReaderWriter.dll
    *** PROBING against System.Web.HttpUtility.dll
    *** PROBING against System.Transactions.Local.dll
    *** PROBING against System.Threading.ThreadPool.dll
    *** PROBING against System.Threading.Thread.dll
    *** PROBING against System.Threading.Tasks.Parallel.dll
    *** PROBING against System.Threading.Tasks.dll
    *** PROBING against System.Threading.Overlapped.dll
    *** PROBING against System.Threading.Channels.dll
    *** PROBING against System.Threading.dll
    *** PROBING against System.Text.RegularExpressions.dll
    *** PROBING against System.Text.Encoding.Extensions.dll
    *** PROBING against System.Text.Encoding.dll
    *** PROBING against System.Security.Principal.Windows.dll
    *** PROBING against System.Security.Cryptography.X509Certificates.dll
    *** PROBING against System.Security.Cryptography.Primitives.dll
    *** PROBING against System.Security.Cryptography.Encoding.dll
    *** PROBING against System.Security.Cryptography.Csp.dll
    *** PROBING against System.Security.Cryptography.Algorithms.dll
    *** PROBING against System.Security.Claims.dll
    *** PROBING against System.Security.AccessControl.dll
    *** PROBING against System.Runtime.Serialization.Xml.dll
    *** PROBING against System.Runtime.Serialization.Primitives.dll
    *** PROBING against System.Runtime.Serialization.Json.dll
    *** PROBING against System.Runtime.Serialization.Formatters.dll
    *** PROBING against System.Runtime.Numerics.dll
    *** PROBING against System.Runtime.Loader.Tests.dll
    *** PROBING against System.Runtime.Loader.Test.ContextualReflectionDependency.dll
    *** PROBING against System.Runtime.Loader.dll
    *** PROBING against System.Runtime.InteropServices.RuntimeInformation.dll
    *** PROBING against System.Runtime.InteropServices.JavaScript.dll
    *** PROBING against System.Runtime.InteropServices.dll
    *** PROBING against System.Runtime.Extensions.dll
    *** PROBING against System.Runtime.CompilerServices.VisualC.dll
    *** PROBING against System.Runtime.CompilerServices.Unsafe.dll
    *** PROBING against System.Runtime.dll
    *** PROBING against System.Resources.Writer.dll
    *** PROBING against System.Resources.ResourceManager.dll
    *** PROBING against System.Reflection.TypeExtensions.dll
    *** PROBING against System.Reflection.Primitives.dll
    *** PROBING against System.Reflection.Metadata.dll
    *** PROBING against System.Reflection.Extensions.dll
    *** PROBING against System.Reflection.Emit.Lightweight.dll
    *** PROBING against System.Reflection.Emit.ILGeneration.dll
    *** PROBING against System.Reflection.Emit.dll
    *** PROBING against System.Reflection.DispatchProxy.dll
    *** PROBING against System.Reflection.dll
    *** PROBING against System.Private.Xml.Linq.dll
    *** PROBING against System.Private.Xml.dll
    *** PROBING against System.Private.Uri.dll
    *** PROBING against System.Private.DataContractSerialization.dll
    *** PROBING against System.Private.CoreLib.dll
    *** PROBING against System.ObjectModel.dll
    *** PROBING against System.Numerics.Vectors.dll
    *** PROBING against System.Net.WebSockets.Client.dll
    *** PROBING against System.Net.WebSockets.dll
    *** PROBING against System.Net.WebProxy.dll
    *** PROBING against System.Net.WebHeaderCollection.dll
    *** PROBING against System.Net.WebClient.dll
    *** PROBING against System.Net.Sockets.dll
    *** PROBING against System.Net.ServicePoint.dll
    *** PROBING against System.Net.Security.dll
    *** PROBING against System.Net.Requests.dll
    *** PROBING against System.Net.Primitives.dll
    *** PROBING against System.Net.Ping.dll
    *** PROBING against System.Net.NetworkInformation.dll
    *** PROBING against System.Net.NameResolution.dll
    *** PROBING against System.Net.Mail.dll
    *** PROBING against System.Net.HttpListener.dll
    *** PROBING against System.Net.Http.dll
    *** PROBING against System.Memory.dll
    *** PROBING against System.Linq.Queryable.dll
    *** PROBING against System.Linq.Parallel.dll
    *** PROBING against System.Linq.Expressions.dll
    *** PROBING against System.Linq.dll
    *** PROBING against System.IO.Pipes.dll
    *** PROBING against System.IO.MemoryMappedFiles.dll
    *** PROBING against System.IO.IsolatedStorage.dll
    *** PROBING against System.IO.FileSystem.Watcher.dll
    *** PROBING against System.IO.FileSystem.DriveInfo.dll
    *** PROBING against System.IO.FileSystem.AccessControl.dll
    *** PROBING against System.IO.FileSystem.dll
    *** PROBING against System.IO.Compression.ZipFile.dll
    *** PROBING against System.IO.Compression.Brotli.dll
    *** PROBING against System.IO.Compression.dll
    *** PROBING against System.IO.dll
    *** PROBING against System.Globalization.dll
    *** PROBING against System.Formats.Asn1.dll
    *** PROBING against System.Drawing.Primitives.dll
    *** PROBING against System.Drawing.dll
    *** PROBING against System.Diagnostics.Tracing.dll
    *** PROBING against System.Diagnostics.TraceSource.dll
    *** PROBING against System.Diagnostics.TextWriterTraceListener.dll
    *** PROBING against System.Diagnostics.StackTrace.dll
    *** PROBING against System.Diagnostics.Process.dll
    *** PROBING against System.Diagnostics.FileVersionInfo.dll
    *** PROBING against System.Diagnostics.DiagnosticSource.dll
    *** PROBING against System.Diagnostics.Debug.dll
    *** PROBING against System.Diagnostics.Contracts.dll
    *** PROBING against System.Data.Common.dll
    *** PROBING against System.Console.dll
    *** PROBING against System.ComponentModel.TypeConverter.dll
    *** PROBING against System.ComponentModel.Primitives.dll
    *** PROBING against System.ComponentModel.EventBasedAsync.dll
    *** PROBING against System.ComponentModel.dll
    *** PROBING against System.Collections.Specialized.dll
    *** PROBING against System.Collections.NonGeneric.dll
    *** PROBING against System.Collections.Immutable.dll
    *** PROBING against System.Collections.Concurrent.dll
    *** PROBING against System.Collections.dll
    *** PROBING against System.Buffers.dll
    *** PROBING against ReferencedClassLibNeutralIsSatellite.dll
    *** PROBING against ReferencedClassLib.dll
    *** PROBING against NuGet.Frameworks.dll
    *** PROBING against netstandard.dll
    *** PROBING against mscorlib.dll
    *** PROBING against Mono.Options.dll
    *** PROBING against Microsoft.Win32.Registry.dll
    *** PROBING against Microsoft.Win32.Primitives.dll
    *** PROBING against Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
    *** PROBING against Microsoft.TestPlatform.PlatformAbstractions.dll
    *** PROBING against Microsoft.TestPlatform.CoreUtilities.dll
    *** PROBING against Microsoft.DotNet.XUnitExtensions.dll
    *** PROBING against Microsoft.DotNet.XHarness.TestRunners.Xunit.dll
    *** PROBING against Microsoft.DotNet.XHarness.TestRunners.Common.dll
    *** PROBING against Microsoft.DotNet.RemoteExecutor.dll
    *** PROBING against Microsoft.Diagnostics.Runtime.dll
    

    So I wonder, if this is a test setup issue where the satellite assemblies are not passed as extra assemblies so that they're added into the bundle, or if customers will hit this issue with their satellite assemblies?

    Also, I don't see the assembly culture being taking into consideration at all, since we have two satellite assemblies with the same name in this scenario one for en and one for es-MX

    What are your guys recommendations here?

  6. self-assigned this
    on Jul 25, 2020
  7. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 25, 2020
  8. safern commented on Jul 25, 2020

    @safern
    Member

    Another thing I notice for the satellite assemblies is that we lowercase the file name but we're comparing against the bundle list of names which are not lowercase.

  9. steveisok commented on Jul 27, 2020

    @steveisok
    Member

    Interesting. Would PublishTrimmed include the satellite assemblies in the output?

  10. safern commented on Jul 27, 2020

    @safern
    Member

    @eerhardt @marek-safar for that question.

  11. eerhardt commented on Jul 27, 2020

    @eerhardt
    Member

    Would PublishTrimmed include the satellite assemblies in the output?

    Yes. Satellite assemblies coming from a NuGet package don't get passed to the ILLinker at all. They are always copied to the publish directory by the Publish target.

    cc @sbomer

  12. safern commented on Jul 28, 2020

    @safern
    Member
  13. SamMonoRT commented on Aug 10, 2020

    @SamMonoRT
    Member

    cc: @CoffeeFlux will reach out to @safern

  14. modified the milestones: 5.0.0, 6.0.0 on Sep 3, 2020
  15. ghost locked as resolved and limited conversation to collaborators on Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions