xamarin/Xamarin.Forms

Crash when trying to include resource dictionary from another resource dictionary

オープン

#3,655 opened on 2018/08/24

 (2 件のコメント) (4 件のリアクション) (1 人の担当者)C# (1,926 件のフォーク)batch import
a/Xaml </>help wantedi/hight/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

When trying to include resource dictionary from another resource dictionary, exception occurs: Xamarin.Forms.Xaml.XamlParseException: Position 6:25. Resource 'GlobalResources.xaml' not found.

Included test app that reproduces issues has following structure:

Resources/GlobalResources.xaml Resources/LabelStyles.xaml <- includes GlobalResources.xaml
MainPage.xaml <- includes LabelStyles.xaml

Workaround: Strangely, issue doesn't occur when xml declaration:

<?xaml-comp compile="true" ?> is included at top of dictionary file that references another dictionary. [assembly: XamlCompilation(XamlCompilationOptions.Compile)] does not seem to affect bug occurence.

Steps to Reproduce

  1. Include two pure XAML resource dictionaries to forms project
  2. Include top dictionary in page or other XAML file

Expected Behavior

App should not crash

Actual Behavior

App crashes with resource not found exception

Basic Information

  • Version with issue: 3.1.0.697729
  • IDE: Visual Studio 17 15.8
  • Platform Target Frameworks:
    • Android: 8.1
  • Affected Devices: Multiple(tested on Galaxy S8)

Screenshots

image

Reproduction Link

DictLink.zip

コントリビューターガイド