Исключение файла XAML для предварительного просмотра Silverlight - PullRequest
1 голос
/ 29 апреля 2010

Я обновил свой проект Silverlight с 2 до 3 и использую VS 2008. Когда я открываю предварительный просмотр XAML-файла в VS 2008, произошло исключение:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at MS.Internal.XcpImports.RenderTargetBitmapRenderNative(IntPtr nativePtr, IntPtr element, Int32& dirtyX, Int32& dirtyY, Int32& dirtyWidth, Int32& dirtyHeight)
   at MS.Internal.XcpImports.RenderTargetBitmapRender(HostingRenderTargetBitmap bitmap, UIElement visual, Int32& dirtyX, Int32& dirtyY, Int32& dirtyWidth, Int32& dirtyHeight)
   at System.Windows.Interop.HostingRenderTargetBitmap.Render(UIElement visual)
   at MS.Internal.Silverlight.Host.RuntimeInterop.RenderElementToTargetBitmap(Int32 elementKey, Int32 targetBitmapIdentifier)
   at MS.Internal.Silverlight.Host.Interop.RenderElementToTargetBitmap(Int32 element, Int32 targetBitmapIdentifier, ISilverlightContentDownloadCallback urlcallback)
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.UpdateBitmap()
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.UpdateTree()
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.CiderInternalImage.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Silverlight.Host.CiderSilverlightImageHost.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.UIElement.UpdateLayout()
   at System.Windows.Interop.HwndSource.Process_WM_SIZE(UIElement rootUIElement, IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Interop.HwndSource.LayoutFilterMessage(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)

Почему сложно запустить Silverlight 3? Вот код:

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

Width="400" Height="150">
    <Grid x:Name="LayoutRoot" Background="White" ShowGridLines="False">
    <Rectangle Style="{StaticResource PopupRectangle}"/>
    <Border Width="400"
            Style="{StaticResource BorderThin}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="20"/>
                <RowDefinition Height="70"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70"/>
                <ColumnDefinition Width="310"/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="Anteckning"
                   Grid.Row="1"
                   Grid.Column="0"/>
            <TextBox x:Name="txtNote"
                 Grid.Row="1"
                 Grid.Column="1"
                 TextWrapping="Wrap"
                 VerticalScrollBarVisibility="Auto"
                 Margin="5"/>                
        </Grid>
    </Border>
</Grid> </UserControl>

1 Ответ

3 голосов
/ 29 апреля 2010

Visual Studio 2008 не поддерживается для предварительного просмотра файлов XAML - эта очень старая функция была удалена для окончательного выпуска инструментов Silverlight 3.

Silverlight 3 и 4 поддерживают предварительный просмотр XAML в Visual Studio 2010.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...