Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0x8001010E (RPC_E_WRONG_THREAD) on Windows API call #45071

Closed
aemarco opened this issue Nov 22, 2020 · 3 comments
Closed

0x8001010E (RPC_E_WRONG_THREAD) on Windows API call #45071

aemarco opened this issue Nov 22, 2020 · 3 comments
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

Comments

@aemarco
Copy link

aemarco commented Nov 22, 2020

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 ?

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 22, 2020
@aemarco aemarco changed the title 0x8001010E (RPC_E_WRONG_THREAD) 0x8001010E (RPC_E_WRONG_THREAD) on Windows API call Nov 22, 2020
@AaronRobinsonMSFT
Copy link
Member

@aemarco This seems to be using the C#/WinRT generated source for WinRT API support. I would recommend filing the issue at https://github.com/microsoft/cswinrt. The built-in support for WinRT APIs was removed in .NET 5 - see #37672.

@AaronRobinsonMSFT AaronRobinsonMSFT added tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly and removed untriaged New issue has not been triaged by the area owner labels Nov 30, 2020
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the Future milestone Nov 30, 2020
@aemarco aemarco closed this as completed Nov 30, 2020
@aemarco
Copy link
Author

aemarco commented Nov 30, 2020

microsoft/CsWinRT#612

@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

4 participants