0x8001010E (RPC_E_WRONG_THREAD) on Windows API call #45071
Labels
area-Interop-coreclr
tracking-external-issue
The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Milestone
Description
Windows Api "SetImageStreamAsync" broke with upgrade to .net5
It now throws an Exception --> 0x8001010E (RPC_E_WRONG_THREAD) after porting from .netcore3.1 to net5.0.
Reproduce the problem
https://github.com/aemarco/LockScreenTest.git
contains a sample project with nothing but the failing api call in App.xaml.cs.
It should be as easy as checking the repo out and run.
Working condition (netcore3.1)
By changing back to .netCore 3.1 as below, the lockscreen will get successfully set
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
Expectations
By specifying the TargetFramework with the windows version, api´s supposed to be functional.
Questions
Maybe you have a hint were to read up about that "define version number to access windows api" concept.
https://docs.microsoft.com/en-us/dotnet/standard/frameworks
explains that till the -windows, but not the part with the version number and api projections(which i learned through .netconf).
Should it not be possible to target "net5.0-windows", guard against specific api calls, dropping the "feature" when not on supported version, but call them if version >= needed ?
The text was updated successfully, but these errors were encountered: