Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Linker doesn't support WinRT #1151

Closed
Closed

Description

@MichalStrehovsky

Trying to scan System.Runtime.WindowsRuntime hits problems because linker doesn't seem to handle the projections well. It's possible we'll need features on the cecil side - see jbevain/cecil#394 that has Unity's WinRT support.

It's possible we can just close this as Won't fix when dotnet/runtime#35318 lands, but I think we should track this here for now (so that there's an issue to refer to).

Activity

  1. added this to the .NET5.0 milestone on Apr 28, 2020
  2. removed this from the .NET5.0 milestone on Apr 28, 2020
  3. eerhardt commented on Apr 28, 2020

    @eerhardt
    Member

    Note we also have this in dotnet/runtime today:

    https://github.com/dotnet/runtime/blob/19cc81be8e31a0d005d860952cf70f6b4ce2b0ae/eng/illink.targets#L65-L67

        <PropertyGroup>
          <!-- Currently ILLink cannot handle type projections from Windows.winmd, disable if the project references it -->
          <ILLinkTrimAssembly Condition="'%(ReferencePath.FileName)%(ReferencePath.Extension)' == 'Windows.winmd'">false</ILLinkTrimAssembly>
        </PropertyGroup>

    If this gets fixed, we should be able to fix that. However, we might also need to worry about COM interfaces at that point. See #378 and dotnet/corefx#32491 (comment).

  4. mrvoorhe commented on Apr 29, 2020

    @mrvoorhe
    Contributor

    In case it's ever of help, here is the logic we have in our UnityLinker to deal with com https://gist.github.com/mrvoorhe/ee5c2d8506e8f7489e683b0ab299e197

    We probably have tests somewhere. Ping me if someone ever wants them.

  5. MichalStrehovsky commented on Jul 7, 2020

    @MichalStrehovsky
    MemberAuthor

    WinRT support won't be needed because .NET 5 WinRT support is moving out of the runtime to external tools that will run before linker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions