在遇到XAML初始化时出现的错误的Visual Studio软崩溃 [英] Visual Studio soft-crashing when encountering XAML Errors in initialize

查看:296
本文介绍了在遇到XAML初始化时出现的错误的Visual Studio软崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有一些与Visual Studio 2010为后期的严重问题。它已经崩溃的时候,我中遇到某些类型的XAML错误的的InitializeComponent()控制/窗口。

I've been having some serious issues with Visual Studio 2010 as of late. It's been crashing in a peculiar way when I encounter certain types of XAML errors during the InitializeComponent() of a control/window.

的程序中断和Visual Studio老沈像它捕获异常(因为它),然后中途停止在我没有细节XAML文件显示一个破碎的亮点是为什么是错误的。例如:

The program breaks and visual studio gears up like it's catching an exception (because it is) and then stops midway displaying a broken highlight in my XAML file with no details as to what is wrong. Example:

没有弹出出局,还是细节的任何地方什么是错的,只是调用栈指向我的的InitializeComponent()通话。

There is not pop outs, or details Anywhere about what is wrong, only a callstack that points to my InitializeComponent() call.

现在通常我只是做了一些试验和错误来解决这个问题,并找出我搞砸了,但真正的问题是不是我的code。 Visual Studio中呈现的完全无用的在这一点上。据报道我的应用程序仍处于运行模式。在工具栏上或在菜单中的停止/中断/重启按钮,什么也不做(但变灰)。

Now normally I'd just do some trial and error to fix this problem, and find out where i messed up, but the real problem isn't my code. Visual Studio is rendered completely useless at this point. It reports my application still in "Running" mode. The Stop/Break/Restart buttons on the toolbar or in the menus don't do anything (but grey out).

关闭应用程序不停止这种行为,关闭Visual Studio中得到它停留在一个巨大的循环,这骂我诉说每一个文件打开是不是在调试项目,然后重复这个过程,当我有exausted每一个打开的文件。

Closing the application does not stop this behaviour, closing visual studio gets it stuck in a massive loop where it yells at me complaining every file open is not in the debug project, then repeats this process when i have exausted every open file.

我要强行关闭 devenv.exe的,并在此之后发生3-4连续时候,它是一个很大的浪费时间(因为我的项目通常pretty的大和工作室可以说是相当缓慢的加载@)。

I have to force-close devenv.exe, and after this happening 3-4 times in a row it's a lot of wasted time (as my projects are usually pretty big and studio can be quite slow @ loading).

给点

  1. 在有其他人遇到此?
  2. 如何阻止工作室抱死。
  3. 我可以至少获取信息的此兽的另一种方式,所以我可以解决我的XAML错误越早越好后3-4试错编译产生死机一样?

&任何放大器;所有的帮助将是AP preciated。

Any & All help would be appreciated.

Visual Studio 2010的版本: 10.0.30319.1RTM

Visual Studio 2010 version: 10.0.30319.1RTM

修改和放大器;更新

FWIW,主要是导致此错误是 XamlParseExceptions (我想通了这一点后,我发现了什么是错的我的XAML)。

FWIW, mostly the errors that cause this are XamlParseExceptions (I figured this out after i found what was wrong with my XAML).

我想我需要更清晰,虽然的,我不是在寻找解决我的code的问题,因为这些通常都是错别字/小东西,我在寻找解决VStudio让所有鸡奸作为一个结果。

I think I need to be clearer though, Im not looking for the solution to my code problem, as these are usually typos / small things, I'm looking for a solution to VStudio getting all buggered up as a result.

在上面的图片是100%肯定引起这是特殊的误差 XamlParseException 由于忘记一个属性上的数据触发。

The particular error in the above image that 100% for sure caused this was a XamlParseException caused by forgetting a Value attribute on a data trigger.

我已经固定的一部分,但它仍然没有告诉我为什么我的工作室成为绝育计划的肿块时,一个完全正常的异常被抛出在XAML的解析。

I've fixed that part but it still doesn't tell my why my studio becomes a lump of neutered program when a perfectly normal exception is thrown in the parsing of the XAML.

code,这将导致此问题(至少对我来说)

这是基本模板WPF应用程序,具有以下 Window.xaml code。现在的问题是缺少值=真< D​​ataTrigger ...> 在模板中。它生成一个 XamlParseException 和Visual Studio崩溃所描述的调试时,在它上面。

This is the base template WPF Application, with the following Window.xaml code. The problem is a missing Value="True" on the <DataTrigger ...> in the template. It generates a XamlParseException and Visual Studio Crashes as described above when debugging it.

<Window x:Class="XamlParseExplosion.MainWindow"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   Title="MainWindow" Height="350" Width="525">
  <Window.Resources>
   <DataTemplate x:Key="BankListItemTemplate">
    <Border x:Name="ItemBorder" Width="250" Margin="1" BorderBrush="Blue" BorderThickness="5,0,0,0">
     <Grid>
      <Label Content="{Binding Name}" />
     </Grid>
    </Border>
    <DataTemplate.Triggers>
     <DataTrigger Binding="{Binding IsDirty}">
      <Setter TargetName="ItemBorder" Property="BorderBrush" Value="Red" />
     </DataTrigger>
    </DataTemplate.Triggers>
   </DataTemplate>
  </Window.Resources>
  <Grid>
   <ListView ItemTemplate="{StaticResource BankListItemTemplate}" />
  </Grid>
 </Window>

最后说明

在以下解决方案的没有帮助我:

The following solutions did not help me:

  1. 在重新启动的Visual Studio
  2. 重新启动
  3. 在重新安装的Visual Studio
  4. 禁用的加载项类似ReSharper的&放大器;反射

我要添加到这个(为伪的答案),因为我发现了这个后,我想传递下去的人发现这个问题在谷歌的更多信息。

Update (Way Later) w/ Answer

I want to add to this (as a pseudo answer) because I found out more information about this later that I want to pass along to people finding this question in google.

真正的问题: XamlParseException是在调试中选择 - >异常发生时折断,因为这样的WPF wireup vstudio过程中会发生不能正确捕捉它(通常它会掉下来一对夫妇更水平和处理在那里有vstudio可以处理它)。

The Real Problem: XamlParseException was selected in Debug -> Exceptions to break when it occurs, because this happens during the WPF wireup vstudio cannot catch it correctly (normally it would fall down a couple more levels and be handled there where vstudio could handle it).

简单地把它们关掉,生活将再次成为不错的。

Simply turn that off and life will be good again.

我不想把这个作为一个答案,因为通过mazelo提供的答案是正确的也当vstudio被以管理员身份运行它似乎能够正确捕捉异常和调试从那里,所以我不想拿走他的回答地位,因为他的解决方案确实可行。

I didn't want to put this as an answer because the answer provided by mazelo was correct too, when vstudio is run as Administrator it seems to be able to catch the exception properly and debug from there so I didn't want to take away his answered status because his solution does work.

推荐答案

我也有类似的问题。几个小时后,我有主意,启动Visual Studio为管理员。解决了这一问题,但还是不知道为什么。

I had a similar problem. After hours i had the idea to start visual studio as admin. Fixed the problem, but still don't know why.

这篇关于在遇到XAML初始化时出现的错误的Visual Studio软崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆