Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Aug 26, 2010 12:56 am Post subject: Unhandled Exception when loading WPF Application |
|
|
If you are using .NET Encryptor to bootstrap a WPF application that does not have any application resources defined then you may receive an error similar to:
Quote: | ---------------------------
Bootstrap Error
---------------------------
An unhandled exception (Cannot locate resource 'window1.xaml'.) occurred while bootstrapping the application. |
This error only occurs if there are no resources defined in App.xaml (or Application.xaml for VB.NET). To workaround the issue you can simply add a dummy application resource eg
Code: | <Application x:Class="TestWpfApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<!-- At least one application resource must be defined to avoid a "Cannot locate resource"
exception when loading the application using the .NET Encryptor bootstrapper -->
<SolidColorBrush x:Key="Dummy" Color="Yellow"></SolidColorBrush>
</Application.Resources>
</Application> |
_________________ Infralution Support |
|