Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unhandled Exception when loading WPF Application

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> .NET Encryptor FAQ
View previous topic :: View next topic  
Author Message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Aug 26, 2010 12:56 am    Post subject: Unhandled Exception when loading WPF Application Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> .NET Encryptor FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group