Open jabberscript opened 3 months ago
Could this be related to #4390 ?
Looking at it, it could very well be. Thanks! I'll go through the suggested steps and see if it helps in our case.
OK, so setting <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
on the 1.5 test project and publishing as /p:SelfContained=True makes it so that the published app is able to be launched.
Is the plan, then, that it will only be possible in future to publish as a single file if the app is self contained? Fine, if so. I just need to make a decision which way to go.
I believe it was <EnableMsixTooling>true</EnableMsixTooling>
that messes with the copying of the resource file.
Describe the bug
When publishing an unpackaged app configured to publish as a single file using the latest stable version of the 1.5 App SDK, the resource files are not copied to the publish directory as they were when using Windows App SDK v1.4. This includes any assets set to copy always, the resources.pri and bootstrap dll.
This causes the published app to be unable to launch when using v.1.5.
I notice that there is a warning generated during the build and publish for a 1.5 app. Is there a new way that we're supposed to achieve this? I would really prefer to publish my app as a single exe, if possible.
Steps to reproduce the bug
PublishTest.zip
The attached test app recreates the issue. I used this command (cribbed from our devops build agent) to publish the projects, substituting in the path to each project file:
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\msbuild.exe" "<PATH TO .csproj>" /nologo /nr:false /t:Rebuild;Publish /p:DebugSymbols=false /p:DebugType=None /p:DeleteExistingFiles=True /p:RuntimeIdentifier=win-x64 /p:PublishSingleFile=True /p:SelfContained=False /p:NuGetInteractive=True /p:platform="x64" /p:configuration="Release" /p:VisualStudioVersion="17.0"
It will likely be necessary to restore the nuget packages before running this command.
Expected behavior
Expect that the resource files should be copied to the publish directory so that the app is able to run.
Screenshots
1.4 output:
1.5 output:
NuGet package version
Windows App SDK 1.5.5: 1.5.240627000
Packaging type
Unpackaged
Windows version
Windows 10 version 21H2 (19044, November 2021 Update)
IDE
Visual Studio 2022
Additional context
No response