-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
InvestigateRequires further investigation by the WPF team.Requires further investigation by the WPF team.
Description
Bug Description
When building a WPF project, a runtime error occurs stating that the App.xaml resource file cannot be found.
The root cause appears to be that the file name App.xaml is forcibly changed to lowercase (app.xaml) during the build process.
Steps to Reproduce
Create or open a WPF project targeting .NET (NET 10).
Build the project.
Run the application.
The application crashes with a resource-not-found error for App.xaml.
Expected Behavior
The original App.xaml file name should be preserved, and the WPF application should properly locate the resource at runtime.
Actual Behavior
During the build process, App.xaml is automatically renamed to app.xaml.
As a result, the application throws a runtime error saying the App.xaml resource cannot be found.
Error Message (Runtime)
Unable to find resource 'app.xaml'.
Workaround
DesktopApp.Production.csproj
<PropertyGroup>
<StartupObject>DesktopApp.Production.Start</StartupObject>
</PropertyGroup>
Start.xaml
<local:Startup
x:Class="DesktopApp.Production.Start"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DesktopApp.Production">
<Application.Resources />
</local:Startup>
Start.xaml.cs
public partial class Start : Startup
{
[STAThread]
public static void Main()
{
var App = new Start();
App.Run();
}
}
Startup.cs
public class Startup : StartupBase
{
}
Metadata
Metadata
Assignees
Labels
InvestigateRequires further investigation by the WPF team.Requires further investigation by the WPF team.