dotnet / dotnet/wpf

"The component does not have a resource identified by the uri" when starting .NET 5 app without debugger

Open
#4,090 3 comments 2 reactions 0 assignees View on GitHub
Bug Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: .NET 5 (5.0.102)
* Windows version: Windows 10 x64 (latest)
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Not using .NET Framework anymore, but it does not reproduce in Core 3.1.

After initial issues with .NET 5 which I now could fix I face the problem that I cannot start our application without debugger anymore. As soon as I change all projects to TFM "net5.0-windows" (app is windows only) I get the exception:

> System.Exception: Die Komponente "SomeApp.SplashScreen" verfügt nicht über eine Ressource, die vom URI "/SomeApp;V2021.0.191.22089;component/splashscreen.xaml" identifiziert wird.
> at void System.Windows.Application.LoadComponent(object component, Uri resourceLocator)
> at void SomeApp.SplashScreen.InitializeComponent() in F:/Arbeit/SomeApp vNext/SomeApp vNext/SomeApp GF/SplashScreen.xaml:line 1
> at new SomeApp.SplashScreen() in F:/Arbeit/SomeApp vNext/SomeApp vNext/SomeApp GF/SplashScreen.xaml.cs:line 12
> at void SomeApp.App.OnStartup(StartupEventArgs e)+() => { } in F:/Arbeit/SomeApp vNext/SomeApp vNext/SomeApp GF/App.xaml.cs:line 228
> at void DevExpress.Xpf.Core.SplashScreenManager+ThreadContainerImpl.ShowWindow(object startupParam)
> at void System.Threading.ThreadHelper.ThreadStart_Context(object state)
> at void System.Threading.ThreadHelper.ThreadStart(object obj)

When I start with the debugger attached, it starts without any issues and works perfectly fine. To rule out that this is a DevExpress issue I can only tell that we're using the correct .NET Core packages and furthermore it works perfect with .Net Core 3.1. We're using latest DevExpress Core 20.2.5 packages.

**Actual behavior:** Instant crash when the first window (SplashScreen) is being initialized, error stack trace above.

**Expected behavior:** Start without any exceptions.

**Minimal repro:** I cannot share the project as it is company property. I simply changed all TFMs of our solution from *netcoreapp3.1* to *net5.0-windows*. That's all. One thing has been changed though: I added `false` to every project since we don't need them and our plugin-system has issues when it finds assemblies twice.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.