PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

An error "Cannot access a disposed object..." pops up when save Python Project File.

Open linette-zyy opened this issue 2 years ago • 3 comments

Environment image

Steps to Reproduce

  1. Create a new Python project
  2. Create a virtual environment
  3. Close the VS
  4. Click “Save” to save some changes image image
  5. And then click "Yes" image

Expected behavior The changes can be saved without any error.

Additional context and screenshots An error pops up. image

linette-zyy avatar Mar 24 '22 05:03 linette-zyy

I'm able to repro this, but it has nothing to do with my previous bug like I thought it did.

This only seems to happen when you try to exit visual studio immediately after modifying the pyproj (by adding a new environment). You'll know you did it right because it opens the Save File As dialog, when it really should just be saving the file over the existing one without opening that dialog.

I don't think this is a PTVS problem, I think this is a race condition in Visual Studio itself, since we don't own the process of saving files, nor do we have anything called FileChangeService.

I will reach out to the Visual Studio team about this, I don't think its ours.

AdamYoblick avatar Mar 24 '22 19:03 AdamYoblick

I can repro in today's build 17.2.0 Preview 3.0 [32328.412.main]. when a project add reference from another project, then close VS

linette-zyy avatar Mar 29 '22 05:03 linette-zyy

image This issue still reproduced on today's build. image

linette-zyy avatar Apr 07 '22 06:04 linette-zyy

@linette-zyy Does this still repro?

AdamYoblick avatar Feb 02 '23 22:02 AdamYoblick

@AdamYoblick I can not repro this in today's latest build:17.6.0 Preview 1.0 [33402.156.main],Python Packages:17.0.23033.1

linette-zyy avatar Feb 03 '23 02:02 linette-zyy

Closing since this no longer repros. Please re-open if this comes up again 😄

AdamYoblick avatar Feb 03 '23 21:02 AdamYoblick