none
Visual Studio 2015 Solution Explorer Directory Refresh

    Question

  • I can't get VS 2015 to refresh the contents of its directories if changes are made to the files from outside the IDE.

    I'm running Visual Studio Professional 2015 14.0.25431.01 Update 3, purchased recently - specifically so I could use the same IDE for Python that I was familiar with from VB.net.  I'm 10+ hours into trying to make it refresh a simple directory and another 10+ hours into trying to make it correctly highlight a shell script file (different post on that).  I've lost a lot of productivity and I'm pretty frustrated.

    My project is a Python project.  I chose to use an existing folder structure when it was created.  Deleting the solution/project and re-creating works, but nothing else does.

    I've searched extensively for solutions to this and have tried several things, including:

    • uninstalling plugins
    • unloading and reloading the project
    • 'touching' the project or solution file to force it to reload
    • After plugin removal, doing a full repair of VS 2015 from add/remove programs and rebooting.
    • Giving up and using VS Code - solved the folder problem, but I couldn't get code completion to work with Python as well as with Intellisense in VS2015.  It worked one level deep into my custom objects, but not as deep as VS2015.
    • Giving up and using PyCharm - same problem as VS Code
    • Tried VS 2017 RC due to its stated support of folder based projects.  Found Python has been disabled in latest build.


    Possible hints for the cause:

    • My projects directory is in my OneDrive folder, which I wanted to do for backup and remote access purposes.  I used the local d:\ path, and not the special path when creating the project.
    • The project is Python, which is less common/tested than .net
    • The project contains many files (12,295) and is set to show all files.  I need to be able to find and edit a variety of text, config files, and legacy script files, including files without an extension, as well as the Python code.
    • When searching for the problem, I saw that many of the solutions showed a project refresh button.  As you can see from my screenshot, I don't have one.  Did that get patched out?

    The below screenshot illustrates the problem with a live VS solution explorer view next to a Windows explorer showing the same folder and a file I deleted from Windows explorer, but that won't come out of VS.  Managing all files from within VS isn't an option due to how I'm publishing and syncing the project.

    VS 2015 Folder Refresh Problem

    Wednesday, February 8, 2017 2:56 PM

Answers

  • Hi jbhurst,

    Welcome to the MSDN forum.

    Refer to your description, I tried to create a new Python Application or other project and I found the result is just like yours. When you delete the files from File Explorer and the VS can detect this change, so the file be marked with a yellow exclamation mark like your screenshot, then you can right click this file and choose ‘Delete’ as below:

     It looks like this is by designed and you can have a try with other project templates on your side, check if this behavior happens for other projects. To my understanding, it is reasonable and like we need to make a second confirmation when we try to remove a file from the project, in case we accidently delete from File Explorer. When you try to directly delete the file under Solution Explorer, it will also popup a little confirmation windows to ask you to confirm this action.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by jbhurst Thursday, February 9, 2017 1:56 PM
    Thursday, February 9, 2017 3:17 AM
    Moderator

All replies

  • Hi jbhurst,

    Welcome to the MSDN forum.

    Refer to your description, I tried to create a new Python Application or other project and I found the result is just like yours. When you delete the files from File Explorer and the VS can detect this change, so the file be marked with a yellow exclamation mark like your screenshot, then you can right click this file and choose ‘Delete’ as below:

     It looks like this is by designed and you can have a try with other project templates on your side, check if this behavior happens for other projects. To my understanding, it is reasonable and like we need to make a second confirmation when we try to remove a file from the project, in case we accidently delete from File Explorer. When you try to directly delete the file under Solution Explorer, it will also popup a little confirmation windows to ask you to confirm this action.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by jbhurst Thursday, February 9, 2017 1:56 PM
    Thursday, February 9, 2017 3:17 AM
    Moderator
  • I'm not sure what the value in flagging the file for confirmation is, since the file is already gone.  What is to confirm?

    Regardless, it does look like I'm trying to use Visual Studio in a way it wasn't intended.  It also looks like Visual Studio 2017 will have a feature to do what I am looking for that is more similar to Visual Studio Code: https://www.visualstudio.com/vs/visual-studio-2017-rc/  "a new way of view, edit, and debug any code without projects and solutions."

    Finally, noticing your exclude from project underline above, I realized I can exclude large amounts of the files from the project but still see them by selecting "show all files".  I think when this project was created, *.* was marked for inclusion.  When the file is excluded form the project, but show all files is on, adds and deletes to the solution folder files from outside VS are automatically and immediately shown.  I think your reply plus this addendum is the answer.  Thanks for your help.

    Thursday, February 9, 2017 1:56 PM
  • Hi jbhurst,

    I'm so glad to hear that your issue is solved and thank you for your sharing :)

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 10, 2017 1:56 AM
    Moderator