Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The breakpoint will not currently be hit. No symbols have been loaded for this document in Unity

I am trying to debug a coroutine in Unity using VS2017.

When I attach VS to Unity and set a breakpoint inside the IEnumerator method I get the error "Breakpoint will not be hit"

enter image description here

It is discussed in depth here: How do I remedy the "The breakpoint will not currently be hit. No symbols have been loaded for this document." warning?

However none of those answers worked for me.

Do you know how to set a breakpoint inside an IEnumerator in VS2017?

like image 707
Aggressor Avatar asked Oct 13 '17 00:10

Aggressor


People also ask

How do you fix the breakpoint will not currently be hit no symbols loaded for this document?

Start debugging, as soon as you've arrived at a breakpoint or used Debug > Break All , use Debug > Windows > Modules . You'll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information.

How do you activate a breakpoint?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.


1 Answers

This is known bug in Unity. Here is how to fix this:

1.Go to File --> Build Settings... then select your platform.

2.Click on Player Settings --> Other Settings and change the API Compatibility Level to .NET 2.0.

If it is already set to .NET 2.0, change it to .NET 2.0 Subset then back to .NET 2.0.

3.Close and re-open Visual Studio. From Visual Studio, go to Build --> Clean Solution then Build --> Rebuild Solution.

Try debugging again and it should work.


If the steps above did not work, Go your Project's Library folder then deltete it. Restart both Unity and Visual Studio.

like image 141
Programmer Avatar answered Nov 15 '22 07:11

Programmer