Skip to content

Calling UWP from .NET Core 2.0 #590

@nesherhh

Description

@nesherhh

Is it possible to call Windows 10 APIs (UWP) from a .NET Core 2.0 App?
It does work from .NET Framework 4.7, but not from .NET Core 2.0.
I'm getting this exception at runtime:

System.TypeLoadException: Could not load type 'System.Threading.Tasks.AsyncCausalityTracer' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   at System.Threading.Tasks.AsyncInfoToTaskBridge`2..ctor(CancellationToken cancellationToken)
   at System.WindowsRuntimeSystemExtensions.AsTask[TResult](IAsyncOperation`1 source, CancellationToken cancellationToken)
   at System.WindowsRuntimeSystemExtensions.AsTask[TResult](IAsyncOperation`1 source)
   at System.WindowsRuntimeSystemExtensions.GetAwaiter[TResult](IAsyncOperation`1 source)
   at ClassLibrary1.Class1.<Abc>d__0.MoveNext() in c:\tmp\ConsoleApp1\ClassLibrary1\Class1.cs:line 12
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ConsoleApp1.Program.<Main>d__0.MoveNext() in c:\tmp\ConsoleApp1\ConsoleApp1\Program.cs:line 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions