ReBuild output produces backup files in Visual Studio 2022

Steve Finner 0 Reputation points
2023-11-23T16:54:29.0666667+00:00

We have multiple projects in VS 2022 mostly using VB.Net.

When we do a Rebuild Solution on a project, the results sometimes produces backup files of our output files.

Example: We have a simple application with 2 projects that also use Newtonsoft.Json.dll.

When we first compile this Solution, the output folder shows 3 files;

MyApp.exe

MyApp_Data.dll

Newtonsoft.Json.dll

Later we do another Rebuild Solution

The output folder now shows the following

MyApp.exe

MyApp_Data.dll

Newtonsoft.Json.dll

MyApp 2.exe

MyApp_Data 2.dll

Newtonsoft.Json 2.dll

This numeric "backup" will continue (3, 4, 5 ...").

Note: not ALL Rebuilds seem to generate the extra backup files.

How do I stop this from occurring if we don't want this to happen?

Thanks,

Steve

Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2023-11-24T07:52:23.67+00:00

    Hi @Steve Finner

    Welcome to Microsoft Q&A! 

    Could you create a new project and check if it occurs in other projects? I tried it on my side and couldn’t reproduce the issue. 

    You can try the following workarounds:

    1. Update your VS2022 to the latest version with Visual Studio Installer.
    2. Enter “devenv /ResetSettings” at Developer Command Prompt for VS 2022 to restore your Visual Studio default setting.
    3. In your project properties > Build Events, please check if you use a build event to customize the project’s build. 

    If it persists, maybe you can check the detailed output by setting Tools > Options > Projects and Solutions > Build And Run > MSBuild project build output verbosity option to Detailed

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.