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

Investigate AddPackageAsync hangs #1720

Open
manodasanW opened this issue Aug 23, 2024 · 7 comments
Open

Investigate AddPackageAsync hangs #1720

manodasanW opened this issue Aug 23, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@manodasanW
Copy link
Member

Determine whether issue still repros with recent version and investigate:

dotnet/wpf#4097

@manodasanW manodasanW added the bug Something isn't working label Aug 23, 2024
@ekalchev
Copy link

ekalchev commented Aug 24, 2024

This is easily reproducible. Just create an empty WPF app with .net 8.0 and call

await packageManager.AddPackageAsync(...)

it is not reproduced every time but usually on every 5 calls, hangs at least 1 time. It is only reproducible in Release

Calling the method synchrously packageManager.AddPackageAsync(...).GetWaiter().GetResult()
is a workaround for this issue but we noticed the installation of the same package is noticeable slower using the synchronous call.

This is not reproduced in WinUI3 app (or it is possible to be much harder to be reproduced)

@ekalchev
Copy link

ekalchev commented Sep 17, 2024

We found that calling Task.Run(() => packageManager.AddPackageAsync(...).GetWaiter().GetResult())
from net48 application also causes AddPackageAsync task never to resolve.

The deadlocks are reproduced ONLY with Release builds

@dongle-the-gadget
Copy link
Contributor

net48 has a different WinRT runtime, not CsWinRT.

@ekalchev
Copy link

ekalchev commented Sep 17, 2024

net48 has a different WinRT runtime, not CsWinRT.

We are able to reproduce the deadlock with both .net8.0 and net48. I know that net core uses CsWinRT package and net48 uses Microsoft.Windows.SDK.Contracts but I am not sure where to submit a bug for Microsoft.Windows.SDK.Contracts

@ekalchev
Copy link

ekalchev commented Sep 17, 2024

We found that if we turn off optimization for (net48) in Release it works.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
      <Optimize>False</Optimize>
</PropertyGroup>

@manodasanW
Copy link
Member Author

manodasanW commented Sep 18, 2024

@ekalchev Are you using CsWinRT projections that you generate in net48 or are you using the built-in support?

@ekalchev
Copy link

ekalchev commented Sep 19, 2024

We are using this nuget version https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts. We tried older version and it is still reproducible.

As much as I know CsWinRT nuget package can be used only with .net core 5 or later. So for net48 we use the nuget package above. Keep in mind the issue is present in both .net48 apps and .net core apps

We also reproduce with with .net8 app and using <TargetFramework>net8-windows10.0.17763</TargetFramework>

If you can't reproduce it, we can provide a code that reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants