问题
Visual Studio 2017 breaks in debug mode and displays the message:
Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code).
The message is in the Break Mode Window
.
What to do?
回答1:
Click on "Continue execution"
Then you will have the stacktrace in the output tab
回答2:
- First check all your common exception setting run time in your visual studio so that you can get the actual error.
- During loading you application check that is their any method which is throw new NotImplementedException();
In my case i use INavigationAware which was throw new NotImplementedException(); i just remove those
In you all project update all from nuget.
Clean and rebuild you project.
回答3:
In my case I just need to restore the list of exception settings to the default settings.
回答4:
I got this situation when my "Platform Target" in my Project Properties was set to "Any CPU" and "Prefer 32-bit" was selected.
I switched Platform Target to "x64" since I am using 64-bit assemblies and then I could run/debug normally.
回答5:
This solution is for people who get this error in WPF application. I got this error when i moved mainwindow.xaml to view folder and forgot to update in App.Xaml. after updating as StartupUri="View/MainWindow.xaml" the main window loaded without warning.
回答6:
This type of issue please check property and Accessories. We should return correct field and check value field.
Example:
private string NameField;
public string Name
{
get
{
return NameField;
}
set
{
nameField=value;
}
}
回答7:
For me, I received the error when my console application was set in Release Mode. Switching to Debug mode fixed the issue.
回答8:
First drag the Break Mode Window
to the Call Stack Window
to get an overview again.
Then, check whether the Solution Explorer Window
is in source mode.
The 4th button from the left has a drop-down. Make sure the *.sln, i.e. classic solution mode is selected.
I didn't know this and was surprised to find that in "source mode", i.e. the other possibility, the above mentioned message is displayed.
回答9:
I got this when I accidentally set the startup project to a class library instead of the end project (in this case, a WPF application).
回答10:
Observed same error and resolved it by:
- Removing duplicate configs from section
- Removing extra/unused characters (by mistakenly entered)
回答11:
This occurred for me when I placed the connectionStrings config item in the wrong spot in app.config.
回答12:
check your Ip address (it must be the same as the listening adress if you'r not using the loopbach address)
回答13:
Error: IOException Cannot locate resource
Most of the time this error occur when using visual studio form applications.
To solve this error you can go to your App.xaml
file and edit SratupUri
to your current xaml form name.
<Application x:Class="AppName.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
回答14:
Check for any case of circular dependency while injecting dependencies.
回答15:
You can also experience this issue if you've altered the build process with something like this to remove the PDB files. Typically I recommend if you want to remove the PDB files make the configuration specific to the "Release" configuration:
<Target Name="RemoveTranslationsAfterBuild" AfterTargets="AfterBuild" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<RemoveDir Directories="@(FluentValidationExcludedCultures->'$(OutputPath)%(Filename)')" />
<ItemGroup>
<PDBFilesToDelete Include="$(TargetDir)\*.pdb"/>
</ItemGroup>
<Delete Files="@(PDBFilesToDelete)" />
</Target>
Then Follow @Eric's recommendations when debugging run the build under the "Debug" configuration.
回答16:
I got similar issue, after spending 2 days we figured out it was due to my application was terminated from out side at the same time I was debugging.
回答17:
I had a similar issue when debugging a VSTO Excel add-in. After trying everything, I resolved the issue by disabling a realtime protection module on my antivirus software.
来源:https://stackoverflow.com/questions/46634776/your-app-has-entered-a-break-state-but-there-is-no-code-to-show-because-all-thr