[英]Is there any option to set in Visual Studio 2008 that would turn off the Silverlight XAML preview by default?
[英]Silverlight preview XAML file exception
我已將Silverlight項目從2升級到3,並使用VS2008。在VS 2008中打開XAML文件預覽時,發生了異常:
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>
不支持Visual Studio 2008預覽XAML文件-Silverlight 3工具的最終版本已刪除了這一非常老的功能。
Silverlight 3和4確實在Visual Studio 2010中支持XAML預覽。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.