App crashes in release mode loading embedded images

edited January 2016 in Xamarin.Forms

I have a shared project with embedded images. A helper class loads these images at runtime. These images are used in styles in the XAML page. App runs fine in debug mode, release mode on Simulator but crashes when run in release mode on an iPhone 6S with iOS 9.2. The crash dump has an entry

"Cannot find assembly MyProject or on of its dependencies"

If references to all embedded images are removed, app runs fine.

Xamarin.Forms is at

<Style x:Key="imageStyle" TargetType="Image">
    <Setter Property="MinimumHeightRequest" Value="180" />
    <Setter Property="MinimumWidthRequest" Value="180" />
    <Setter Property="HeightRequest" Value="180" />
    <Setter Property="WidthRequest" Value="180" />
    <Setter Property="Source" Value="{c:ImageResource MyProject.Images.Login.png}" />

<Image Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" x:Name="loginImage" 
                Style="{StaticResource imageStyle}">

ImageResource is the helper class that loads the embedded images

Any leads on how to debug this using the crash dump highly appreciated.



  • RamsCHOARamsCHOA USMember


    Ensure that the Assembly name in the project options dialog for the iOS project is set to MyProject.

    Right click in MyProject.iOS
    Select Options to open the Project Options dialog
    Click the Output option on the left side in the Build section
    If Assembly name is missing, embedded images in the shared project will not load.

Sign In or Register to comment.