Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baml Decompiler Exception: ArgumentException: Cannot find StaticResource #445

Closed
mzboray opened this issue Mar 12, 2014 · 2 comments
Closed

Comments

@mzboray
Copy link

mzboray commented Mar 12, 2014

I've got a relatively simple XAML:

<UserControl x:Class="BamlTest.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"           
             mc:Ignorable="d">
    <UserControl.Resources>
        <Style TargetType="Control" x:Key="baseStyle" />
    </UserControl.Resources>
    <Grid>
        <Grid.ContextMenu>
            <ContextMenu>
                <ContextMenu.Resources>
                    <Style TargetType="Control" BasedOn="{StaticResource baseStyle}" />
                </ContextMenu.Resources>
            </ContextMenu>
        </Grid.ContextMenu>
    </Grid>
</UserControl>

I compiled using VS 2012. However when decompiling the assembly, I get

System.ArgumentException: Cannot find StaticResource: 0
Parameter name: identifier
at Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.GetStaticResource(Int16 identifier)
at Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.ReadPropertyWithStaticResourceIdentifier()
at Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.ProcessNext()
at Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.ReadInternal()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at ILSpy.BamlDecompiler.BamlResourceEntryNode.LoadIntoDocument(IAssemblyResolver resolver, AssemblyDefinition asm, Stream stream)
at ILSpy.BamlDecompiler.BamlResourceEntryNode.LoadBaml(AvalonEditTextOutput output)
at ILSpy.BamlDecompiler.BamlResourceEntryNode.<>c__DisplayClass3.b__1()

@badmotorfinger
Copy link
Contributor

Can you please attach the DLL as I cannot reproduce the issue.

@mzboray
Copy link
Author

mzboray commented Apr 18, 2014

Let me know if that works for you

On Thu, Apr 17, 2014 at 8:48 PM, Vince Panuccio [email protected]:

Can you please attach the DLL as I cannot reproduce the issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/445#issuecomment-40784833
.

siegfriedpammer added a commit that referenced this issue Apr 18, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants