Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
3
Question by andycruce · Sep 23, 2017 at 05:05 PM · c#debugvs

Breakpoints not working

I checked the monodevelopment breakpoints not working post but it was from a number of years ago and about monodevelopment.

I am using VS 2015 and overnight the breakpoints stopped working. I tried closing everything out an restarting the system - didn't help. Tried different versions of VS - didn't help. Tried using monodevelopment - didn't help.

When I put in a breakpoint in VS attach the C# to unity and run the project the breakpoints are just ignored. Don't know if anything else in debug works since I can't stop the program

Anyone know what is going on and how to fix it? Really hard to do debugging without a debugger!

Comment
Add comment
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

5 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by andycruce · Sep 27, 2017 at 11:57 AM

I have the same problem. I watched the video but it didn't address the problem. Fro some reason something changes in the the VS-Unity connection and instead of a red dot for the breakpoint I get a hollow red/yellow dot. When I highlight it I get the following message:

The breakpoint will not be currently hit. Unable to find corresponding location.

I tried selecting Attach Unity Debugger in the debug dropdown in VS but this didn't work. I have reinstalled Unity and that didn't clear up the problem either. I am using VS 2107.

I've seen other posts describing this problem but no solutions!

Comment
Add comment · 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
3

Answer by guneyozsan · Nov 08, 2019 at 01:28 PM

It happens to me probably after a non-Monobehavior or an abstract class and/or its file name is renamed within VS, or after some files are renamed from Unity. Usually generic abstract classes cause the problem. I suppose somehow the code sync with Unity breaks.

  • Close VS.

  • Delete Assembly-CSharp.csproj and Assembly-CSharp-Editor.csprojin your project folder.

  • Open VS.

Edit:

I believe there are more than one issue that causes the same problem.

In some cases where base class is generic, sometimes I can activate break points if I rename generic base classe and file name to ClassName_1 and ClassName_1.cs, where the number is the number of generic types by convention (ex: public abstract class ClassName_1<T> : MonoBehavior)

Comment
Add comment · Show 1 · 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 LiefLayer · Apr 11, 2021 at 09:33 AM 0
Share

For anyone that got the same problem. You should also restart Unity3d to regenerate Assembly-CSharp.csproj and Assembly-CSharp-Editor.csproj after you delete them. Just opening VS again will not help. Still this solve the problem.

avatar image
1

Answer by liquidbuddha · May 25, 2018 at 08:22 PM

I am also having the same issue. :( VS 7.5.1, Unity 2018.1.0f2. Re-importing all assets seemed to clear up 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 $$anonymous$$ · Sep 12, 2018 at 07:57 AM 0
Share

did help me too (Unity 2018.2.6f1 VS 15.8.4)

avatar image jamesnw · Oct 02, 2018 at 01:44 AM 0
Share

I'm constantly having the same/similar issue. Seems like only the breakpoints are hit for code in $$anonymous$$onoBehaviour class files, but not in utility class files (completely ignored). In fact, I can step through into the utility code files from a behavior, but the breakpoints inside the utility class files are completely ignored. Also, System.Diagnostics.Debugger.Break(); is completely ignored, as is Debug.Break(). I'm not resorting to throwing and catching exceptions in my utility classes in order to debug them, which is getting really annoying. I noticed my code files getting out of sync also, causing code to stop on incorrect lines, or stopping on invalid code frames. It seems like reimporting the script folder within Unity fixes everything - only until I edit the code in VisualStudio and try to launch debugging from VS as well. This setup is not very reliable as my project is growing.

avatar image
0

Answer by Flokky_ · Sep 24, 2017 at 10:22 AM

You can try this tutorial: For the MonoDevelop
Or: For the VisualStudio

Comment
Add comment · 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
0

Answer by ckaith97 · Sep 04, 2020 at 11:36 PM

I had a similar problem, but a different outcome. (In case others are stumbling across this problem today.)

Consider C# classes that use inheritance (with a base class and a child class). If I put a breakpoint in the base class, but the object in the game contains the child class, the execution won't stop at that breakpoint. It runs the code and prints any Debug.Log(...), but doesn't stop at the breakpoint.

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

445 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 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 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 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 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

How to properly display debug messages on UI 0 Answers

VS Code missing UnityEngine.UI 1 Answer

Help me debug the issue 0 Answers

Modified Save/Load methods not saving properly 1 Answer

Partial Snapshot of Game Screen 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges