Double clicking error in console doesn't go to line in VS Code etc

If I have an error in the console, I have usually just double clicked on the error and it goes straight to the line in the script

However, now it is just staying on the line I was at previously and doesn’t update.

Does anyone have any ideas? I’m using Visual Studio Code (which is becoming a bit of a time-consuming burden tbh).

1 Like

I went to browse in preferences and reselected code.exe
in
C:\Users\username\AppData\Local\Programs\Microsoft VS Code
and it seems to work now

Hi, I’m having the same problem too, double-clicking a line in the Console output no longer takes me to the relevant line of code. Nor does that action (or any other similar “Edit Script” action)do anything but open the relevant file. It no longer opens the Solution file or any Project files.

@davidnibi
I didn’t quite understand what you meant by “reselect”-ing an .exe file, at first. Until I re-read what you said and went to Unity’s “Preferences/External Tools” menu and selected (in my case) Visual Studio 2019 (Community) and now it works for me as well. Just FYI for anyone that’s having the same issue.

3 Likes

Hey all, I had the same problem. I tried all that was mentioned above and it didn’t work. What did work though was clicking on the console settings (three dots in the corner of the console window) and making sure the Stack Trace Logging\Error\ is not set to “Full,” rather it should be “Editor Only.”

Does someone know why this is the case?

5 Likes

reimport your project :wink:

1 Like

For me, in Unity I went to Edit> Preferences, and in there, External Tools. There I clicked a button that said “Regenerate Program Files”

2 Likes

I just came across this issue myself and my fix was:
In Unity:
Click Edit → Preferences → Click external tools
Then at the top where it says External Script Editor, Choose the proper Visual Studio you want to use.
Mine was set on “Open by file Extension”
As soon as I set it to: “Visual Studio 2019”
It worked perfect.

3 Likes

For me what fixed it:
in console: first click the three dots in the right > stack trace logging > all > full
Then click play (now it won’t work)
then in console again: click the three dots in the right > stack trace logging > all > script only
Click play
Now clicking in the console should open the script and jump to the correct line.

15 Likes

None of the above worked for me. I’m not sure why changing the logging would have an impact to begin with.

I’m seeing this in editor:


Microsoft Visual Studio is Version 16.10.4

I have my tools configured here:

And [Regenerate project files] has no effect. I’ve restarted my project and the editor, the issues still persist.

1 Like

This worked for me using Mac and Unity 2021. Thank you.

Solved it for me , thanks!

2 Likes

thanks a lot

1 Like

Hey, had this issue after a random crash, turn out my game’s project somehow switched to “release mode”. Switching back to debug mode solved the issue. (unity2021.1)
7907137--1007926--upload_2022-2-18_13-50-37.png

1 Like

thank a lot great to know.

Thank you very much!!!

My solution for this issue on 2021.3.5f1

6 Likes

Thankssss

This was the only thing that worked for me (Unity 2020.3.30f1, Visual studio Community 2019 Version 16.11.20

1 Like

Thank you! This worked for me on Unity 2023.2.6f1.

Thank you

Lots of necroposting here. Please use the “Like” button to show your appreciation.

Thanks.

Thread Closed.

1 Like