Exception in the designer when viewing XAML

Navigation for WPF Forum

Posted 11 years ago by chris caldwell
Avatar
I get the following exception when viewing the WPF sample windows in the VS2008 designer pane:

startIndex cannot be larger than length of string.
Parameter name: startIndex

at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at MS.Internal.Host.PersistenceSubsystem.ExtractSourceFileInfo(Uri uri)
at MS.Internal.Host.PersistenceSubsystem.FormatInnerXamlParseException(Exception ex)
at MS.Internal.Host.PersistenceSubsystem.ReportException(Exception ex, TextModel model, Int64 sourceVersion)
at MS.Internal.Host.PersistenceSubsystem.Load()
at MS.Internal.Host.Designer.Load()
at MS.Internal.Designer.VSDesigner.Load()
at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
at MS.Internal.Designer.DesignerPane.LoadDesignerView()

Here's the XAML:
<Window 
    x:Class="EOG.UI.NavigationBarWindow1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" 
    xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"     
    xmlns:navigation="http://schemas.actiprosoftware.com/winfx/xaml/navigation"     
    Title="NavigationBarWindow1" 
    MinWidth="400" MinHeight="300" Height="450" Width="800">
    
    <Border Background="{DynamicResource {x:Static themes:NavigationBarCommonDictionary.WindowBackgroundBrushKey}}">
        
        <Grid Margin="5">
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            
            <Grid.RowDefinitions>
                <RowDefinition />
            </Grid.RowDefinitions>
            
            <navigation:NavigationBar x:Name="navBar" Grid.Column="0"></navigation:NavigationBar>           
            
            <GridSplitter Grid.Column="1" ResizeDirection="Columns" ResizeBehavior="PreviousAndCurrent" Background="Transparent" Width="5" />
            
            <Border 
                Grid.Column="2" 
                BorderThickness="1" 
                BorderBrush="{DynamicResource {x:Static themes:NavigationBarCommonDictionary.BorderBrushKey}}"
                Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" 
                Padding="7"
                >
                <!-- Other content here -->
            </Border>

            <GridSplitter Grid.Column="3" ResizeDirection="Columns" ResizeBehavior="PreviousAndNext" Background="Transparent" Width="5" />

            <navigation:ExplorerBar x:Name="expBar" Grid.Column="4"></navigation:ExplorerBar>
            
        </Grid>        
        
    </Border>
    
</Window>
Any help would be appreciated. Thanks.

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hmm, I'm not able to duplicate it here. I loaded it exactly as you typed it, but I had to take out the x:Class line since we don't have that codebehind. Other than that it was the same in the XAML view in VS and then when clicking the designer tab, it came up ok.

That stack trace is completely in Microsoft's code though. So if anything it would seem that perhaps this is bug in their code. Are you running VS 2008 RTM? That is what I tried it on, and on XP.


Actipro Software Support

Posted 11 years ago by chris caldwell
Avatar
Yes, I am running 0.0.21022.8 RTM. I noticed that once I receive the error, if I compile and reload the designer, all is good. However, after switching back from XAML to the Designer, it returns. I too noticed the stack trace was within the MS code base. What version of VS2008 are you running.

Thanks.
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Looks like I was using the same build: 9.0.21022.8 RTM.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.