Open s5bug opened 2 years ago
I spent a lot of time trying to fix this issue. See these related discussions:
Here's what I think I know:
Microsoft.ui.xaml.dll
from when you had WindowsAppSDKSelfContained=true
, so make sure you clean between builds when testing different configurations.What I'm currently doing is building unpackaged+self-contained during development (because many debuggers, profilers, etc. don't support packaged apps well) and building packaged+runtime-dependent for releases to save space. Those are the only two configurations I've found that work.
As an aside, I haven't been able to find a good way to build the same project separately for packaged+runtime-dependent and unpackaged+self-contained or to switch between them easily. Ideally the different options in launchsettings.json (Project vs MsixPackage) could be used to set WindowsAppSDKSelfContained
appropriately and trigger a rebuild but I couldn't make it work.
@mattico
As an aside, I haven't been able to find a good way to build the same project separately for packaged+runtime-dependent and unpackaged+self-contained or to switch between them easily. Ideally the different options in launchsettings.json (Project vs MsixPackage) could be used to set WindowsAppSDKSelfContained appropriately and trigger a rebuild but I couldn't make it work.
I have had success using Directory.Build.props
to switch between them.
Hi @rocksdanister, could you elaborate on how you use Directory.Build.props to switch between packaged and unpackaged. Thank you.
Create Directory.Build.props file in project folder:
<Project>
<PropertyGroup>
<IsMsixRelease>false</IsMsixRelease>
</PropertyGroup>
</Project>
Then add the different flags in csproj file:
<PropertyGroup Condition="'$(IsMsixRelease)' != 'true'">
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>
<PropertyGroup Condition="'$(IsMsixRelease)' == 'true'">
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>..
</PropertyGroup>
Hi, thanks for filing this issue. Can you validate this still repros on WinAppSDK 1.4? If so, please provide a minimal sample app. Thanks!
Describe the bug
This is similar to other issues regarding Microsoft.ui.xaml.dll not being located, but with the key difference of I want this app to be able to be framework-dependent.
Steps to reproduce the bug
Using the default WinUI3 C# template,
Set
WindowsPackageType
to `NoneRunning the
(Unpackaged)
version of the project leads toMicrosoft.ui.xaml.dll
not being found.Expected behavior
The project behaves equivalently to if
was set, especially when run on the same machine it is being built.
Yes, setting the project to Self Contained does work, but again I would prefer if Framework Dependent was an option.
Screenshots
NuGet package version
No response
Packaging type
Unpackaged
Windows version
Windows 10 version 21H2 (19044, November 2021 Update)
IDE
Visual Studio 2022, Other
Additional context
I have uploaded a project demonstrating the issue: https://github.com/s5bug/WinUI3-Test