C++ – Visual Studio 2015 Add Class, Error: “object already exists”

cobjectvisual c++visual studiovisual-studio-2015

Other similar but to my knowledge non-related questions:

  • A file or folder with the name '' already exists Visual Studio 2012
  • ATL simple object wizard – "Object Xxx already exists" error
  • The error:
    I try to add a simple class
    enter image description here
    and then proceed to the wizard where I get the following Error]2:
    enter image description here
    "Object already exists".
    I can't add the class "MainGame" (and a few other names) to any project, not even if I create a new project

    How to recreate said bug/error:
    The error occured when I deleted a Release folder I'd accidentally copied over from a project in another solution. All now non-functional class names are derived from the object files within that Release folder.

    Solution:
    I have no solution.

    My questions are:
    Have anyone else had this or a similar issue?
    If so, have you solved it and what is your solution?

    I am open to all suggestions and while this 'bug' isn't making programming impossible it is quite annoying not being able to use frequently used class names.

    Best Answer

    Yeah, also saw that.

    I think I have created a C++ class, decided I don’t like it, reverted changes using github app. But the name was good, so I tried creating same class again. Saw the exact same error as you’re having.

    The name polluted the sqlite database. And because I had that VC.db in my .gitignore, git hasn't reverted that.

    To fix, quit visual studio, delete the file $(SolutionName).VC.db in your $(SolutionDir) folder, restart visual studio, clean and rebuild your project[s].

    Update: Modern versions of Visual Studio usually keep these SQLite databases inside .vs folder under $(SolutionDir).