Visual Studio Clean wiped contents of script source folder

Barry Briggs 1 Reputation point

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.
2,442 questions
Microsoft Build
Microsoft Build
A Microsoft platform for building applications with Visual Studio and .NET on Windows.
369 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 11,201 Reputation points Microsoft Employee

    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.


    • 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.