Beta 2: Entering break mode failed for the following reason

I can not debug my WPF Application, or at least visual studio say so.

Here is the message box:

Microsoft Visual Studio

Entering break mode failed for the following reason: Source file 'f:\WpfApplicationDebug\WpfApplicationDebug\Window1.xaml' does not belong to the project being debugged.

Usually, this condition occurs when the project was not rebuilt prior to starting the debugging session, when the assembly file for the project is out of date, or when the project source files were moved to a different disk location between the time the project was built and the debugging session was started.

Edit and Continue will be disabled for this debugging session.

OK

I tried to create the simplest application.

Here is the Window1.xaml:

Window1.xaml

<Window x:Class="WpfApplicationDebug.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:WpfApplicationDebug"
xmlns:s="clr-namespace:System;assembly=mscorlib"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<s: String x:Key="message">
Hello, World!
</s: String>
<l:DebugConverter x:Key="debugConverter"/>
</Window.Resources>
<Grid>
<TextBlock Text="{Binding Source={StaticResource message}, Converter={StaticResource debugConverter}}"/>
</Grid>
</Window>


and the only code:

Window1.xaml.cs

...

public class DebugConverter : IValueConverter
{
#region IValueConverter Members

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value;
}

#endregion
}
...

I get the message box above when i put a breakpoint on Convert method. "value" is right. Everything looks fine except the message box before breaking. Application runs as expected, but I cannot be sure of that.

I am actually trying to write a relatively complex code with attached properties and markupextensions and there is something going strange there. I thought I would ask before blaming my codeSmile

BTW I thought silverlight tools might have caused these and repaired the visual studio installation without any luck.

// Edit

I forgot to mention that a breakpoint on InitializeComponent(); breaks without any message.

[3096 byte] By [orca] at [2008-1-8]
# 1

This is a Visual Studio problem. Moving from WPF Forums.

Yi-LunLuo-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Orcas IDE, Debugger, Build, Deployment, Help, etc....
# 2
Thanks, I hope I can get an answer here. I thought this error was a language specific error.
orca at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Orcas IDE, Debugger, Build, Deployment, Help, etc....
# 3
I have uninstalled all related products and visual studio and installed VS only again, reseted the settings. There is no difference.

I hope someone comes to rescue before I go mad and format everything. All I need to know is how am i supposed to identify the real source. Is there a simple way to compare compiled files from different machines? or is there another debugger for wpf applications? How come a new install does not fix this?

orca at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Orcas IDE, Debugger, Build, Deployment, Help, etc....
# 4

Thanks for reporting the issue. We understand what is happening and we are looking into what can be done about it. This is caused by the fact that the generated InitializeComponent function has been associated with the XAML file that it is for.

I would expect that you can simply ignore this error. If you can't, you should at least be able to ignore the error by disabling edit & continue (Tools->Options->Debugging->Edit and Continue).

Thanks,

Gregg Miskelly

Visual Studio Debugger Dev

GreggMiskelly-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Orcas IDE, Debugger, Build, Deployment, Help, etc....

Visual Studio Orcas

Site Classified