Skip to content

UAP projects that reference vs-threading fail to compile with .NET Native #557

Closed

Description

Due to dotnet/corert#7372, the code below in vs-threading leads to .NET Native's compilation to fail:

TypedReference tr = __makeref(value);

Activity

  1. added this to the v16.5 milestone on Nov 14, 2019
  2. AArnott commented on Nov 14, 2019

    @AArnott
    MemberAuthor

    I'm drafting a change that adds a UAP10.0 target to the library that omits the problematic code. It also adds a UAP test project to the solution to verify that vs-threading never blocks UAP consumption again.

  3. AArnott commented on Nov 14, 2019

    @AArnott
    MemberAuthor

    onovotny is there any way to add a uap10.0 TFM to my library for the sake of the nuget package target being offered and a C# preprocessor define WINDOWS_UWP, but without breaking dotnet build or requiring the UWP SDK to be installed? I don't really need anything from UWP's SDK -- I just need another TFM with the uap name in my package so I can provide a special build of the library for it.

  4. AArnott commented on Nov 14, 2019

    @AArnott
    MemberAuthor

    Thanks for the tip. That sounds promising. So far though I can't find the right combination of properties to define to get restore and build working without warnings/errors. Any more tips?

    Here's what I've tried.

  5. sharwell commented on Nov 15, 2019

    @sharwell
    Contributor

    What happens if you just use Unsafe.AsPointer instead?

  6. AArnott commented on Nov 15, 2019

    @AArnott
    MemberAuthor

    Not only does that side-step any need for me to target UAP, but it (surprisingly) works on UAP (it doesn't even throw an exception). Thanks for the tip, Sam Harwell (@sharwell).

  7. added a commit that references this issue on Nov 15, 2019
    9f56eac
  8. sharwell commented on Nov 15, 2019

    @sharwell
    Contributor

    Well alrighty then 😄

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions