VS 2019 project file missing

drmliam 6 Reputation points
2022-09-29T17:24:49.127+00:00

Hello Team :)

I have noticed this problem recently across a few different solutions and it has been very bothersome.

When working on a VB.NET solution, making a change to a project (i.e. adding a resource, updating a form) and then attempting to build will sometimes take me to a file explorer that is looking for the .vbproj file.

Before these changes my .vbproj file exists in the directory, yet somehow during the build it is removed. To my knowledge I am not using projects that were developed on an earlier version of visual studio, and all solutions I have found online so far have not worked.

I am tired of constantly saving and copying my work only to have to restore to the previous version a few moments later.

Any guidance on this issue would be greatly appreciated!

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,568 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Michael Taylor 47,966 Reputation points
    2022-09-29T17:32:02.033+00:00

    I'm not aware of any situation in which the project file would be removed. I believe there is something else going on here. Even if it were an older project it would be one-time upgraded when you first opened it and remain thereafter. Some things that come to mind.

    • You have a build task/event that is removing/moving files and it is accidentally picking up the project file
    • Your AV software is detecting that the file is malicious and auto-removing it
    • You are using a source control system that is trying to sync your local copy and is wiping it

    I'm assuming here that your solution file is actually pointing to the correct project file location and not using a different project than what you think it is. I would recommend that you use a file monitoring tool like Process Monitor to monitor delete/move requests to the project file. Then run your build/update your form to replicate the problem. When the file disappears then go to the monitor and see what process did it.

    If for some reason it is the build process then enable diagnostic logging in the build settings and rebuild your solution. Then scan it looking for calls that touch the project file.

    0 comments No comments