Visual Studio Clean wiped contents of script source folder

Barry Briggs 1 Reputation point
2021-03-16T16:23:34.133+00:00

ASP.Net Core project, .NET 5. Have all my TS/JS in a folder called Scripts in wwwroot. Executing a "Clean" command on the solution wiped out all contents of the folder -- many days of work lost. In process of recovering but this seems like a bug or at least something VS should warn about. VS 16.9.0, W10.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,643 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,251 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 25,891 Reputation points Microsoft Vendor
    2021-03-17T04:03:42.84+00:00

    Hi @Barry Briggs ,

    Welcome to Microsoft Q&A!

    The Clean will remove all intermediate and output files created by the build process, such as .obj files.

    If the source folder is removed, please check if you add a custom target to your .csproj file and it will lead to clean all contents of your folder.

    In addition, you can also try to disable some third-party extensions from Extensions > Manage Extensions > Installed > select and Disable, then, relaunch your Visual Studio to check if it persists.

    Sincerely,
    Anna

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.