I am making a plug-in for Bricscad which is basically a dll that is used by the application. This plug-in uses both console commands and WPF windows. When I try to debug it and set breakpoints there is strange behaviour - if the code was called by the command it stops at the breakpoint and it is possible to debug it. However if I open one of my WPF windows and code in question is triggered from it(i.e. by pressing a button) it still breaks at the breakpoint however all I get is this message: "Your app has entered a break state, but no code is currently executing that is supported by the selected debug engine (e.g. only native runtime code is executing)." This happens in the scope of a single dll. dll was built with 4.5.1 .NET framework.
I have checked the modules from studio - dll is loaded as well as symbols for it. I have also tried to uncheck Just My Code option but to no effect. I have checked the threads - in both cases the code was executing in main thread. The only difference that I see is that this message only appears if code is called from WPF window.
Here is an example of xaml file that is used.
<Window x:Class="Plugin.Window"
Title="Window"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
MaxHeight="400"
MinHeight="350"
Width="400"
MinWidth="400" Height="350">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="pack://application:,,,/Resource;component/AppDictonary.xaml">
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Orientation="Vertical" Margin="5">
<Button x:Name="_startButton" Content="Start" Width="100" Click="ButtonStart_Click" />
</StackPanel></Window>
And the function called by WPF
private void ButtonStart_Click(object sender, RoutedEventArgs e)
{
Foo();
}
If a breakpoint in Foo is triggered by a console command in Bricscad the debug is fine. But if its called from ButtonStart_Click the message manifests.
What could be the possible cause of this message? Have anyone encountered this behaviour(maybe in some other dlls)?