Reputation: 525
I have a WinUi 3 (c#)solution that contains 3 projects: A, B, C.
A: main application(exe) depends on B,C.
B: dll project depends on C.
c: dll project.
Now I like to build the solution as a unpacked application and pack it into a wix installer, so I want to reduce the file number of unpacked application as much as I can.
Here is the project file A:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>A</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
<WindowsPackageType>None</WindowsPackageType>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
Here is how I do the publish:
Here is the "publish" folder after publish is successful. Clicking A.exe won't launch the application. However, the A.exe (with about 26 dlls) in the build output folder can be launched by clicking it. Is this expected result? Publish WinUi 3 application as single file does not work for unpacked application?
B.pdb
B.pri
A.exe
A.pdb
C.pdb
C.pri
Upvotes: 0
Views: 863
Reputation: 1
today wasdk v1.5 released with PublishSingleFile Support. so you should update to v1.5 and i suggest you to update your dotnet version to 8
Upvotes: 1