Search

WPF application resources leak into Visual Studio by marcinwis

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 774549
Opened: 12/17/2012 6:14:27 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
Resources defined in Application.xaml somehow find their way into Visual Studio application.

Effects can range from funny visual changes to completely breaking VS functionality.

This applies to both RTM and Update1.

This critical bug prevents usage of VS with certain 3rd party controls that happen to have conflicting keys.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

1. Create WPF app
2. Add to Application.xaml: <LinearGradientBrush x:Key="GlyphBrush" />
3. Rebuild
4. Open MainWindow.xaml
5. Select Window object and show its properties (F4)

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

English

Actual results

Designer crashes with:

InvalidCastException: Unable to cast object of type 'System.Windows.Media.LinearGradientBrush' to type 'System.Windows.Media.SolidColorBrush'.

at Microsoft.Expression.Utility.Controls.Icon.get_GreenChroma()
at Microsoft.Expression.Utility.Controls.Icon.ConvertColor(Color color)
at Microsoft.Expression.Utility.Controls.ColorSwapper.SwapColorsWithoutCloning(Brush brush, ColorCallback colorCallback)
at Microsoft.Expression.Utility.Controls.ColorSwapper.SwapColorsWithoutCloning(Drawing drawing, ColorCallback colorCallback)
at Microsoft.Expression.Utility.Controls.ColorSwapper.SwapColorsWithoutCloning(Drawing drawing, ColorCallback colorCallback)
at Microsoft.Expression.Utility.Controls.ColorSwapper.SwapColorsWithoutCloning(Brush brush, ColorCallback colorCallback)
at Microsoft.Expression.Utility.Controls.ColorSwapper.SwapColors(Brush brush, ColorCallback colorCallback)
at Microsoft.Expression.Utility.Controls.Icon.get_RenderSourceBrush()
at Microsoft.Expression.Utility.Controls.Icon.OnRender(DrawingContext drawingContext)
at System.Windows.UIElement.Arrange(Rect finalRect)
[...]

Expected results

No crash, no strange interactions between Visual Studio and application code.
File Attachments
0 attachments
Sign in to post a comment.
Posted by marcinwis on 2/27/2013 at 3:10 AM
Are you planning to also fix this in Blend bundled with VS2012 ?
Posted by Microsoft on 1/4/2013 at 7:12 PM
Hi Marcin,

We have fixed this issue on our end and the fix will be available as part of next Visual Studio Update. If you need the fix earlier, please send me an email at navits at microsoft dot com and I can share the fix with you.
Posted by marcinwis on 12/20/2012 at 6:52 AM
Same problem applies to Blend for Visual Studio 2012 (5.2.30810.0).
Posted by Microsoft on 12/17/2012 at 6:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.