PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

After adding the file as a link first, the file will not be added to the project.

Open ttSpace opened this issue 3 years ago • 1 comments

Describe the bug

image

Steps to Reproduce

  1. Create a Python Application.
  2. Right click on the project and select Add > Existing Item …
  3. In the prompts dialog, select the item you want to add.( PythonApplication10 )
  4. Click the Add drop-down and select "Add As Link".
  5. Right click on the project and select Add > Existing Item …
  6. Select PythonApplication10 that you chose before, and select "Add". (You can repeat step 5 and step 6)

Expected behavior

After selecting an item "Add As Link" , the item PythonApplication10 should be "Add" in project.

Additional context and screenshots

More than one appeared in SE.( PythonApplication10 Status is "Add As Link" ) And the file PythonApplication10 is not in the directory.

image

image

Restart VS, you can see that there is only one. Then, repeat step 5 and step 6, it can repro this.

image image

Output info

Info: Info: Pylance language server 2021.4.1 (pyright 6410a8a2) startingServer root directory: c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist

Error: Warning: Info: Info: Info: Info: Error reading settings: TypeError: Cannot read property '0' of nullstubPath typings is not a valid directory.Assuming Python platform WindowsSearching for source filesNo source files found.Background analysis(1) root directory: c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist





Info: Background analysis(1) started
Info: Info: Warning: Info: Info: Info: Info: Info: Info: No configuration file found.Setting pythonPath for service "PythonApplication12": "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"stubPath C:\Users\vting\source\repos\PythonApplication12\PythonApplication12\typings is not a valid directory.Assuming Python version 3.9Assuming Python platform WindowsSearching for source filesFound 1 source fileBackground analysis(2) root directory: c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\distBackground analysis(2) started

ttSpace avatar Aug 26 '21 06:08 ttSpace

In today's build 17.1.0 Preview 3.0 [32029.61.main], I can repro this.

ttSpace avatar Dec 30 '21 09:12 ttSpace

@ttSpace Does this still repro? I can't add duplicate projects. image

StellaHuang95 avatar Feb 23 '23 20:02 StellaHuang95

@StellaHuang95 I can repro in today's build 17.6.0 Preview 2.0 [33423.321.main], Python Package: 17.0.23047.1.

Animation01

ttSpace avatar Feb 24 '23 07:02 ttSpace

This will be fixed once the pr is finished here: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/455205

StellaHuang95 avatar Mar 02 '23 01:03 StellaHuang95