• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by lagrier98 · Jun 27, 2018 at 01:52 AM · visual studiodebugging

Breakpoints in Visual Studio debugger are not working

When I hover over the circle next to the breakpoint, I get the following message: “The breakpoint will not currently be hit. Unable to find a corresponding location”.
I’ve tried the following solutions:
- Deleting all files in Library/ScriptAssemblies and restarting Unity (as suggested here)
-Reinstalling Unity
-Reinstalling Visual Studio
-Cleaning and rebuilding my solution in Visual Studio
-Reverting my project to an earlier version and re-adding the changes I want to make to my project
After reverting my project, the debugger started working properly, buy after re-adding the changes, the breakpoints stopped working again
Edit: Also, the compiler is set to debug.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Glurth · Jun 27, 2018 at 03:16 PM 0
Share

$$anonymous$$ake sure the compiler is set to generate a DEBUG (not release) build. $$anonymous$$inda obvious I know, but I still manage to mess it up often enough.

avatar image Glurth Glurth · Jun 27, 2018 at 04:07 PM 0
Share

ok. Here is another check. This one confirms the debugger is attaching to the correct process. First, make sure the game is NOT playing the Unity Editor. Change the Attach To Unity drop down, to the Attach to Unity and Play option, and click it. Does this make the unity editor start playing? Also, are you using any custom/third-party DLLs?

avatar image lagrier98 Glurth · Jun 27, 2018 at 07:25 PM 0
Share

Clicking Attack to Unity and Play from Visual Studio starts the application in Unity. I use two third-party dlls in my application: $$anonymous$$athNet.Numerics and System.Threading.

avatar image hexagonius · Jun 27, 2018 at 06:27 PM 0
Share

another thing if it's a build for UWP, you need to check build C# projects (or whatever the name in PlayerSettings was)

avatar image lagrier98 hexagonius · Jun 27, 2018 at 07:19 PM 0
Share

I'm, not targeting the Universal Windows Platform.

1 Reply

· Add your reply
  • Sort: 
avatar image
6

Answer by lagrier98 · Jul 04, 2018 at 03:54 AM

After playing around a little bit, I tried deleting .meta files in my project and changing the Api Compatibility Level setting (in Edit->Project Settings->Player) from ".NET Standard 2.0" to ".NET 4.x", and this has resolved the issue.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hobwell · Jun 13, 2019 at 02:22 AM 1
Share

Can confirm, the API Compatiblity Setting switch did the trick, did not need to delete .meta files.

avatar image Marshall119 · Jan 22, 2020 at 10:34 AM 0
Share

I found that just changing the setting to either .NET compatibility level is enough. Seems like toggling it must force a regeneration of symbols.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

90 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

VS Code Debugger - Using UnityEngine 0 Answers

Monodevelop and Visual Studio 2015 debugger skips frames 0 Answers

How to use NSight 2 Answers

Visual Studio won't attach to Unity, even after Vs Tools for Unity update 9 Answers

Are conditional breakpoints when debugging in VS2017 working for you? 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges