Visual Studio not launching when selecting edit add-ins

Visual Studio not launching when selecting edit add-ins

paul.slaterMZZFE
Advocate Advocate
5,573 Views
39 Replies
Message 1 of 40

Visual Studio not launching when selecting edit add-ins

paul.slaterMZZFE
Advocate
Advocate

Visual Studio Code will not run when edit is selected. this has become a problem since a Fusion update.

 

would someone be kind enough to help please?

 

thanks Paul.

0 Likes
Accepted solutions (2)
5,574 Views
39 Replies
Replies (39)
Message 21 of 40

goyals
Autodesk
Autodesk

Can you try copying the extension from C:\Users\Admin\.vscode\extensions to %USERPROFILE%\.vscode\extensions and see if it works?



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 22 of 40

goyals
Autodesk
Autodesk
Accepted solution

Created FUS-78088 ticket to track this issue. We will try to resolve it at the earliest. May be you can try workaround of copying the content of folder from C:\Users\Admin\.vscode\extensions to this location %USERPROFILE%\.vscode\extensions and see if it works for you. Thanks for posting it.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 23 of 40

paul.slaterMZZFE
Advocate
Advocate
Goyals -I have asked our IT company to do what you have asked and they have said as I am logged in as admin it is the same location?
FYI I have 2 x pc's that are behaving exactly the same and it has happened after a Fusion update to both machines.
Regards Paul.
0 Likes
Message 24 of 40

goyals
Autodesk
Autodesk

ok. Does that workaround help you?
If %USERPROFILE%\.vscode\extensions resolves to C:\Users\Admin\.vscode\extensions on your machine then I am not sure what else is going wrong. I am not aware of anything we changed in this area in last update which should caused this problem if everything was working as expected previously for you. It might be hard for us to resolve the problem until we are able to reproduce the issue on our side. Any I will discuss it in team and get back to you. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 25 of 40

paul.slaterMZZFE
Advocate
Advocate

Goyals -as i mentioned in my last post our IT company said it was the same location, so unfortunately it made no difference.

 

this problem happened some time ago, maybe from last Sept/Oct i have only just got around to try and fix it because i have a job that requires the functionality. regards Paul.

0 Likes
Message 26 of 40

goyals
Autodesk
Autodesk

I would like to suggest another workaround just in case it might work on your machine. Please try the following script in text command window after switching to python mode.

 

import sys

sys.path.append(<add the folder path of debugPy module present in ms-python extension on your machine>)

 

Meanwhile we are investigation this problem on our side. 



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 27 of 40

goyals
Autodesk
Autodesk

Hi @paul.slaterMZZFE , 

 

I am not able to reproduce this problem on my side so far. Probably you could give a try to following steps

 

1. Execute the below script in Fusion text command window after switching to python mode.

import sys

sys.path.append(<full path of debugpy folder in ms-python extension directory on your disk>)
This you need to do every time Fusion is restarted so probably not ideal for development activity but may be a quick thing to check if it resolves issue for you. 

2. Fusion executes a script, pre-run.py, present in user's app data folder only once per session when user try to edit/debug a script from "Scripts and Add-Ins..." dialog. This script is responsible for installing the extension and adding the path of debugPy module in sys path of Fusion python interpreter.  May be you can edit locatePythonToolFolder function in this file and return the path of debugPy folder on your machine. You should do this step only if # 1 worked for you.

 



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 28 of 40

goyals
Autodesk
Autodesk

I am not able to reproduce this problem on my side so far. Probably you could give a try to following steps

 

1. Execute the below script in Fusion text command window after switching to python mode.

import sys

sys.path.append(<full path of debugpy folder in ms-python extension directory on your disk>)
This you need to do every time Fusion is restarted so probably not ideal for development activity but may be a quick thing to check if it resolves issue for you. 

2. Fusion executes a script, pre-run.py, present in user's app data folder only once per session when user try to edit/debug a script from "Scripts and Add-Ins..." dialog. This script is responsible for installing the extension and adding the path of debugPy module in sys path of Fusion python interpreter.  May be you can edit locatePythonToolFolder function in this file and return the path of debugPy folder on your machine. You should do this step only if # 1 worked for you.

Let me know if a zoom screen sharing session is possible. That might help us to understand the problem on your machine. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 29 of 40

kandennti
Mentor
Mentor

I am using Win10 and VSCode does start.
It may be irrelevant, but I am noticing that there is a slight difference from before.

 

1. Create a new script.
2. Edit the script and start VSCode.
3.Run as debug from VSCode. (It will run.)
4.Quit VSCode once.
5.Delete the ".vscode" folder in the script folder.
6.Start VSCode by editing the script again.
7.It is not possible to run as debug from VSCode.

 

In the past, even if the ".vscode" folder was deleted, the ".vscode" folder was always copied from somewhere when editing, but in Ver2.0.9719, it is no longer copied.

0 Likes
Message 30 of 40

paul.slaterMZZFE
Advocate
Advocate
Kandennti -thank you for your contribution. Obviously I would like to get it running as it was before without all the problems. Regards.
0 Likes
Message 31 of 40

KrisKaplan
Autodesk
Autodesk

FYI: The problem with not re-creating the .vscode folder within a script folder on edit/debug has been fixed and will be in the next update. If you encounter this problem you can just create an empty .vscode folder in your script folder and it will copy the default settings files when launched.

 

Kris



Kris Kaplan
Message 32 of 40

paul.slaterMZZFE
Advocate
Advocate
Kris -thank you, that's good news. I am really busy at the moment so I will wait for the next update where hopefully it will all be working again.
Would you be kind enough to tell me when to expect the update please?
Kind regards Paul.
0 Likes
Message 33 of 40

KrisKaplan
Autodesk
Autodesk
Accepted solution

Paul,

 

This should be in an update set for early March. But if this is the cause of any of your problems, I would not wait for an update to fix it. The trivial workaround would be to just not delete a script's .vscode folder, or to create an empty .vscode folder before using the edit/debug command from the addin manager dialog.

 

Kris



Kris Kaplan
0 Likes
Message 34 of 40

paul.slaterMZZFE
Advocate
Advocate
Hi -I have the latest "early March" update and VScode still does not launch through the API form "edit" or "degug"

Kind regards Paul
0 Likes
Message 35 of 40

Anonymous
Not applicable

I had the same problem. This helped me:

Delete the Python Extension files and the .obsolete file (C:/Users/user name/.vscode/extensions/ms-python.python-20##.###).
Open VS-Code and install the latest Python Extension and "Python for VSCode" (I don't know why, but it works for me).

I honestly don't know if that brings other errors with it.

Hopefully it helps you.

Message 36 of 40

BrianEkins
Mentor
Mentor

@paul.slaterMZZFE, Is this working for you now?

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 37 of 40

paul.slaterMZZFE
Advocate
Advocate
Hi -thank you for the follow up.
Yes, all working now since an update. Not sure why but not complaining!
Kind regards Paul
0 Likes
Message 38 of 40

jaco.waes
Contributor
Contributor

I seem to have the same issue .... suddenly i can no longer link fusion and vscode to debug ... i tried the suggestions from 2 years ago but no luck.

 

When i click edit, a windows command window opens, it downloads the ms-python and ms-python.debugpy extensions when i had deleted them. But then the windows command window closes and vscode does not open ....

 

print(sys.path)

['C:\\Program Files\\Autodesk\\webdeploy\\production\\35a60349b112668a59dd7bbcc68b2622875103f4', 'C:\\Program Files\\Autodesk\\webdeploy\\production\\35a60349b112668a59dd7bbcc68b2622875103f4\\Python\\lib', 'C:\\Program Files\\Autodesk\\webdeploy\\production\\35a60349b112668a59dd7bbcc68b2622875103f4', 'C:\\Program Files\\Autodesk\\webdeploy\\production\\35a60349b112668a59dd7bbcc68b2622875103f4\\Python\\lib\\site-packages', 'C:\\Program Files\\Autodesk\\webdeploy\\production\\35a60349b112668a59dd7bbcc68b2622875103f4\\Python\\DLLs', 'C:\\Users\\jaco\\AppData\\Roaming\\Python\\Python311\\site-packages', 'C:/Program Files/Autodesk/webdeploy/production/35a60349b112668a59dd7bbcc68b2622875103f4/', 'C:/Program Files/Autodesk/webdeploy/production/35a60349b112668a59dd7bbcc68b2622875103f4/nspylib.zip', 'C:/Program Files/Autodesk/webdeploy/production/35a60349b112668a59dd7bbcc68b2622875103f4/Api/Python/packages', 'C:/Users/jaco/AppData/Roaming/Autodesk/Autodesk Fusion 360/MyScripts/', 'C:/Users/jaco/AppData/Roaming/Autodesk/Autodesk Fusion 360/MyScripts/Autorun/', 'C:/Users/jaco/AppData/Roaming/Autodesk/Autodesk Fusion 360/MyScripts/Samples/', 'C:/Users/jaco/AppData/Roaming/Autodesk/Autodesk Fusion 360/MyScripts/ProgramData/', 'C:/Users/jaco/AppData/Roaming/Autodesk/Autodesk Fusion 360/MyScripts/AppData/', 'C:/Users/jaco/AppData/Roaming/Autodesk/Autodesk Fusion 360/MyScripts/ManuallyInstalled/', 'C:\\Users\\jaco\\.vscode\\extensions\\ms-python.python-2024.6.0\\python_files\\lib\\python']



import debugpy
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'debugpy'

 

What seems strange to me is that even though the debugpy extension gets downloaded, it is not added to the path ...

 

 

0 Likes
Message 39 of 40

jaco.waes
Contributor
Contributor

If you end up in this older thread using a search this might be your solution.

 

https://forums.autodesk.com/t5/fusion-api-and-scripts/can-t-edit-or-debug-my-python-scripts/m-p/1275...

Message 40 of 40

jaco.waes
Contributor
Contributor

This exact same behaviour has shown up again for me ...  (2.0.19426)

0 Likes