You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to enable "PublishSingleFile" and attempted to publish it as a single executable file, an error occurred when accessing ResourceManager.Current:
Unable to find the specified file.
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32)
at ABI.Windows.ApplicationModel.Resources.Core.IResourceManagerStaticsMethods.get_Current(IObjectReference)
at Windows.ApplicationModel.Resources.Core.ResourceManager.get_Current()
at Demo.MainWindow..ctor() in E:\Projects\Demo\MainWindow.xaml.cs:line 17
Steps to reproduce the bug
Enable the PublishSingleFile option in win-x64.pubxml
In the constructor of MainWindow, write the following code:
public partial class MainWindow
{
public MainWindow()
{
string filePath = @"D:\demo.txt";
try
{
var curr = ResourceManager.Current;
} catch(Exception e)
{
File.WriteAllLines(filePath, [e.Message, e.StackTrace]);
}
}
}
Publish, then run the exe and check the output errors in the root directory of the D drive:
Unable to find the specified file.
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32)
at ABI.Windows.ApplicationModel.Resources.Core.IResourceManagerStaticsMethods.get_Current(IObjectReference)
at Windows.ApplicationModel.Resources.Core.ResourceManager.get_Current()
at Demo.MainWindow..ctor() in E:\Projects\Demo\MainWindow.xaml.cs:line 17
Describe the bug
When I tried to enable "PublishSingleFile" and attempted to publish it as a single executable file, an error occurred when accessing ResourceManager.Current:
Steps to reproduce the bug
Expected behavior
No response
Screenshots
No response
NuGet package version
Windows App SDK 1.5.5: 1.5.240627000
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
This is the code mentioned above:
Demo.zip
The text was updated successfully, but these errors were encountered: