-
Hi Windows App SDK Team! According to this: link |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Working fine but only in packaged apps and you can not use it in UnPackagaed apps |
Beta Was this translation helpful? Give feedback.
-
If your Windows App SDK app is packaged (MSIX), then it will work with For unpackaged apps, it will just be the folder next to your EXE. So you can use Within XAML or other WinRT APIs, you can also use Uris like |
Beta Was this translation helpful? Give feedback.
-
Even though it is a bit sketchy at times, most WinRT/UWP runtime classes are documented to work in desktop applications. The major issues with that documentation is around the requires package identity. But in general, you can assume that most will work. |
Beta Was this translation helpful? Give feedback.
-
Thank you all for your answers. |
Beta Was this translation helpful? Give feedback.
If your Windows App SDK app is packaged (MSIX), then it will work with
Windows.ApplicationModel.Package.Current.InstalledPath
, yes.For unpackaged apps, it will just be the folder next to your EXE. So you can use
System.Reflection.Assembly.GetEntryAssembly().Location;
orGetModuleFileNameW
to get the EXE path, and then get the directory usingPath.GetDirectoryName
or similar.Within XAML or other WinRT APIs, you can also use Uris like
ms-appx:///Assets
. There is alsoMicrosoft.Windows.ApplicationModel.Resources.ResourceManager
within WinAppSDK, with which you can access any Content resources with a path likeAssets/MyFile.jpg.
. It should also work in unpackages apps afaik.