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

ArgumentNullException when showing TaskDialog is self-contained app #58

Open
VladimirKhil opened this issue Sep 7, 2023 · 0 comments
Open

Comments

@VladimirKhil
Copy link

The reason is that for self-contained apps Assembly.Location is empty here (https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#api-incompatibility):

CoreCLR Version: 6.0.2123.36311
.NET Version: 6.0.21
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.IO.Path.Combine(String path1, String path2)
   at Microsoft.WindowsAPICodePack.Dialogs.EnableThemingInScope.EnsureActivateContextCreated()
   at Microsoft.WindowsAPICodePack.Dialogs.EnableThemingInScope..ctor(Boolean enable)
   at Microsoft.WindowsAPICodePack.Dialogs.NativeTaskDialog.NativeShow()
   at Microsoft.WindowsAPICodePack.Dialogs.TaskDialog.ShowCore()

In the same Microsoft doc it is recommended to use AppContext.BaseDirectory instead of Assembly.Location for such cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant