index > Windows Presentation Foundation ("Avalon") > XamlParseException Line1 Postion 9????

XamlParseException Line1 Postion 9????

Ok i'm getting a XamlParseException in Line 1 Postion 9 well as far as i can see i dont see anything wrong their at all...I just love these Exceptions because theirs No information on how to fix it

Any ideas????

System.Windows.Markup.XamlParseException was unhandled
  Message="Cannot create instance of 'Window1' defined in assembly 'SexyEyesBar, Version=1.0.2460.4298, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'Window1.xaml' Line 1 Position 9."
  Source="PresentationFramework"
  LineNumber=1
  LinePosition=9
  StackTrace:
       at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
       at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
       at System.Windows.Markup.BamlRecordReader.ThrowException(String message, Exception innerException)
       at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
       at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
       at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
       at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
       at System.Windows.Markup.TreeBuilder.Parse()
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
       at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
       at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
       at System.Windows.Navigation.NavigationService.GetObjectFromResponse(WebRequest request, WebResponse response, Uri destinationUri, Object navState)
       at System.Windows.Navigation.NavigationService.DoNavigate(Uri source, NavigationMode f, Object navState)
       at System.Windows.Navigation.NavigateQueueItem.Dispatch(Object obj)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at SexyEyesBar.App.Main() in C:\Documents and Settings\Fusion\My Documents\Visual Studio 2005\Projects\SexyEyesBar\SexyEyesBar\obj\Debug\App.g.cs:line 0
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

Rattlerr
Can you post your XAML?
lee d

Here is the Xaml for Window1 thier are 2 other Windows::

<Window x:Class="SexyEyesBar.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="SeyeEyesBar" Height="448" Width="800" WindowStyle="None" ResizeMode="NoResize" Background="sc#0, 0, 0, 0" AllowsTransparency="True" xmlns:d="http://schemas.microsoft.com/expression/interactivedesigner/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Name="win" Loaded="win_Loaded" ShowInTaskbar="False" WindowStartupLocation="Manual">

<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ResourceDictionary1.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid x:Name="SSAchatSexBar">
<Rectangle Stroke="{x:Null}" RadiusX="15.5" RadiusY="15.5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="5,0,3,-13" Width="Auto" Height="65" x:Name="SEbar" ToolTip="SSAChat ToolBar">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<LinearGradientBrush.RelativeTransform>
<TransformGroup>
<TranslateTransform X="-0.5" Y="-0.5"/>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="90.016662605201432"/>
<TranslateTransform X="0.5" Y="0.5"/>
<TranslateTransform X="1.1102230246251565E-16" Y="0"/>
</TransformGroup>
</LinearGradientBrush.RelativeTransform>
<GradientStop Color="sc#0.762108862, 0.140946835, 0.3367504, 0.880931" Offset="0.20833333333333334"/>
<GradientStop Color="sc#0, 1, 1, 1" Offset="1"/>
<GradientStop Color="sc#0.247749671, 0.138767958, 0.268736184, 0.911278963" Offset="0.625"/>
<GradientStop Color="sc#1, 1, 1, 1" Offset="0"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Grid HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="17,0,0,0" Width="123" Height="47" x:Name="SSAchatLogo">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="123"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="47"/>
</Grid.RowDefinitions>
<Label FontSize="16" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="-9,0,56.92,19.7866666666666" Width="Auto" x:Name="SSAchatLabel" Content="SSA Chat" Foreground="sc#1, 0.5740789, 0.01301869, 0.980690241"/>
<Image Opacity="0.99228752120931563" x:Name="whitegirl_png" Source="whitegirl.png" Margin="0,1,0,-1"/>
</Grid>
<Grid HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="115,0,0,3" Width="239" Height="42" Background="{x:Null}" x:Name="WebSearch">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBox Margin="4,0,3,0" Background="sc#0.5563652, 0, 0, 0" x:Name="webSearchTextBox" OpacityMask="#FFFFFFFF" Text="WebSearch..." TextWrapping="Wrap" FontSize="13" TextAlignment="Justify" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="25.5525" HorizontalContentAlignment="Center" SnapsToDevicePixels="False" Foreground="sc#1, 1, 1, 1" KeyDown="onSearchKeyDown" GotKeyboardFocus="onSearchGotKeyboardFocus" >
<TextBox.BorderBrush>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<LinearGradientBrush.RelativeTransform>
<TransformGroup>
<TranslateTransform X="-0.5" Y="-0.5"/>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="90.016662605201432"/>
<TranslateTransform X="0.5" Y="0.5"/>
<TranslateTransform X="1.1102230246251565E-16" Y="0"/>
</TransformGroup>
</LinearGradientBrush.RelativeTransform>
<GradientStop Color="sc#0.5, 0, 0.264605522, 1" Offset="0.0096153846153846159"/>
<GradientStop Color="sc#0, 1, 1, 1" Offset="1"/>
<GradientStop Color="sc#0.47921133, 0, 0.265, 1" Offset="0.98397435897435892"/>
<GradientStop Color="sc#1, 1, 1, 1" Offset="0.50320512820512819"/>
</LinearGradientBrush>
</TextBox.BorderBrush>
</TextBox>
<Border HorizontalAlignment="Stretch" Margin="-0.99999999999996,4,-2.00000000000009,4" Width="Auto" Background="{x:Null}" x:Name="Border" BorderThickness="1,1,1,1">
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<LinearGradientBrush.RelativeTransform>
<TransformGroup>
<TranslateTransform X="-0.5" Y="-0.5"/>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="90.016662605201432"/>
<TranslateTransform X="0.5" Y="0.5"/>
<TranslateTransform X="1.1102230246251565E-16" Y="0"/>
</TransformGroup>
</LinearGradientBrush.RelativeTransform>
<GradientStop Color="sc#0.684955, 0, 0.264605522, 1" Offset="0.003205128205128205"/>
<GradientStop Color="sc#0, 1, 1, 1" Offset="1"/>
<GradientStop Color="sc#0.47921133, 0, 0.265, 1" Offset="0.99679487179487181"/>
<GradientStop Color="sc#1, 1, 1, 1" Offset="0.50320512820512819"/>
</LinearGradientBrush>
</Border.BorderBrush>
</Border>
</Grid>

<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,49,5" Width="319" Height="38" x:Name="IconScroller">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Button d:LayoutOverrides="GridBox" Style="{DynamicResource GuestSigninButton}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,2,0,0" Width="40" Height="33" Background="{x:Null}" x:Name="RssButtonShow" Grid.Column="0" Grid.Row="0" Content="RSS" Foreground="sc#1, 1, 0, 0" Click="RssButtonShowClick" OpacityMask="{x:Null}" ToolTip="RSS Feeder"/>

<Button d:LayoutOverrides="None" Style="{DynamicResource ManageUsersButton}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,3,2.91666666666674,0" Width="40" Height="33" Background="{x:Null}" x:Name="SSANavButton" Content="SSA" Foreground="sc#1, 1, 0, 0" Click="SSAClick" ToolTip="Go to SSAChat.com"/>

<Button d:LayoutOverrides="GridBox" Style="{DynamicResource ManageUsersButton}" HorizontalAlignment="Left" Margin="54,0,0,2" Width="40" Height="33" Background="{x:Null}" x:Name="StickyNotes" Grid.Row="0" Content="Notes" Foreground="sc#1, 1, 0, 0" ToolTip="Sticky Notes" Click="StickyNotesClick"/>

</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,363,2" Width="15" Height="41" x:Name="Divider">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Opacity="1" HorizontalAlignment="Stretch" Margin="0,0,7,0" Width="Auto" x:Name="divider_png" Source="divider.png"/>
</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,37,1" Width="11" Height="44" x:Name="Divider2">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Margin="0,0,3,0" x:Name="divider_png1" Source="divider.png"/>
</Grid>

<Button VerticalAlignment="Bottom" Margin="361,0,381,8" Height="33" x:Name="SearchButton" Click="SearchButtonClick" Background="{x:Null}" Foreground="sc#1, 1, 0, 0" BorderBrush="{x:Null}" d:LayoutOverrides="GridBox" Style="{DynamicResource ForgotPasswordButton}" Width="Auto" Grid.Column="0" Grid.Row="0" Content="Search" ToolTip="Search the internet"/>

<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,3,12" Width="35" Height="37" x:Name="ExitSSAchatSexBar">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Button Opacity="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="1.99999999999985,-9.59232693276135E-14,0,0" Width="27" Height="27.5533333333333" Background="{x:Null}" x:Name="ExitEliteXP" Foreground="sc#1, 1, 0, 0" BorderBrush="{x:Null}" RenderTransformOrigin="0.5,0.5" Click="ExitEliteXpBar" d:LayoutOverrides="GridBox" Style="{DynamicResource GuestSigninButton}" Grid.Column="0" Grid.Row="0" Content="X" ToolTip="Exit">
<Button.RenderTransform>
<TransformGroup>
<TranslateTransform X="0" Y="0"/>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="179.51337566445633"/>
<TranslateTransform X="0" Y="0"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
</Grid>

</Grid>
</Window>

Rattlerr
Can you try removing the Resourcedictionary part in the resources, I dont know what is in it, without that the window is opening just fine
lee d
The ResourceDictonary holds my ButtonStyles,ListBox Styles,TextBox Styles,Slider Styles and a few others...
Rattlerr
looks like the class Window1 cannot be instantiated... look at the namespaces defined in the xaml....
lester - MSFT

I had exactly the same issue today in exactly same line ..

In my case I had a wrong attribute in the xaml-file. So my conclusion: double-check the xaml-file.

Simsabim

I was also getting same error at runtime.

In .cs file I was trying to set the button name as "1", "2"

so i think check also if you are setting invalid attribute and\or its value.

HTH.

GaneshT

I found out that Expression Interactive Designer uses abit more Mark up in the Window than if you use the Window in Visual Studio...Their is a difference between the 2 when it comes to the Xaml in the first 4 to 5 lines of Code..So what i did was recreate the project starting a new one Deleting the Scene and just adding Windows..If you start the project in Visual Studio and add more windows,thats when i tend to see the XamlParseException come into play...

Not the Differences between the Xaml Markup which i tend to think is what causes the XamlParseException in some other manner other than, the Make up having User Coded Errors...Their are considerable Differences in the way EID and Orcas writes the Xaml Mark up like you see below..

So i think thier could be abit more work on either the EID or Orca's for Visual Studio making the Mark Up more alike.. Here is an example of Both projects Blank::

EID Sept Build::

<Window
 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/interactivedesigner/2006"
 mc:Ignorable="d"      <------------ This line Orca's Dosnt Recoginize produces a Blue Under Score
 x:Name="RootWindow"
 x:Class="UntitledProject1.Window1"
 Title="Root Window"
 SizeToContent="WidthAndHeight">

Visual Studio 2005 "Ocras"::

<Window x:Class="WindowsApplication1.Window1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Title="WindowsApplication1" Height="300" Width="300"

>

Rattlerr
reply 9

You can use google to search for other answers

 

More Articles

• Floating UI Elements in a FlowDocument
• Disable Navigation Hotkeys in a WPF Navigation App
• Disable Antialiasing
• WPF download links
• ToolBar - OverflowGrid style?
• Disabled (grayed) image in button
• Image Slicing
• WPF TextBox disable or handle paste
• MarkupExtension to Connect WPF to CAB Serviecs
• Adding Validation Rules to a DataTemplate programatically
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• DataTemplate vs. ControlTemplate
• Show page in new window with WBA
• Aplying DataTemplate to a Panel
• Reading Bitmap Pixel Colors very fast; M
• Problem using event of Timer to set text
• Force-rendering one control(tree)?
• xmlns deisgner versus compiler assembly
• Update UI Thread from Background Thread
• Using LocBaml.exe Tool
• I'm starting a WPF/WCF/WF game...
• Test if point is in screen
• AutoScrolling Text in a ListBox?? Help P
• How to collapse databound TextBlock
• Animations at GDI speed?
• ItemsControl + FishEyePanel

Hot Articles

• Is this a defect?
• Slider.Value and MethodParameter : type
• Bind To Method Topic is missing from dow
• Sometimes MediaElement plays streams wit
• ObservableCollection for IList
• I want trap attached property change not
• data binding - pass parameter to converter
• How To Get ParserContext?
• WPF download links
• Invalidate Layout
• Resource Dictionary "Adding Stroke/
• Text Box instantly updating?
• Is there a RadioButtonList equivalent fo
• SetValue and Break point
• SpeedRatio BUG?? - OK I'll Try this again

Recommend Articles

• how to get the values back from DataGrid
• xbap's can't upload images??
• Updated answer to "How to bind to s
• Xml databinding drops when launching app
• Feedback please: WPF for LOB application
• Grid resizing to fill the window
• About event handler of overlay controls
• Applying styles at runtime
• [WPF] Performance problems on Windows Vi
• Custom EnumConverter not invoked at desi
• datbing listview with a generic sortedli
• Disable Navigation Hotkeys in a WPF Navi
• DropDown Menu Buttons
• Using LocBaml.exe Tool
• WPF in Vista OS applications?