Visual Studio 2019 Cannot build solutions that are in custom folders

Vladishaa 1 Reputation point
2021-09-20T13:55:05.183+00:00

It always gives me error Project .... couldnt be imported because the file Microsoft.Common.props doesnt exist on the disk. That file does exist. The problem is solved if i save my project in default user/source/repos folder but i want to save it in folder on my desktop

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
961 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 50,426 Reputation points
    2021-09-20T14:10:37.553+00:00

    Visual Studio doesn't care where your project files are. You can literally put them anywhere.

    A word of warning however about putting files on the desktop. In general I would strongly recommend doing this or storing files directly on the desktop. If you do that then every time the desktop is shown (which is all the time) AV has to run to scan the files. The more files you put on the desktop the longer it takes to scan and the slower the desktop responds. If you absolutely must put something on the desktop then store it elsewhere and put a shortcut on the desktop. From a usability point of view you cannot tell the difference but a very small file is faster to scan than the full file.

    I'm also going to say that it sounds like you just want to have quick access to a project. VS already has the Start Window for this so I don't really see any benefit in putting any projects on the desktop (even shortcuts). Additionally VS supports jump lists so recent solutions are accessible directly from the VS icon on your taskbar if needed. So, in general, I wouldn't recommend you store your projects on the desktop at all but, worse case, use a shortcut to the solution folder instead.

    Now back to your problem. Provided VS was properly installed you can put your solution folder anywhere. Open VS and open the solution, then do a build. The location of your project doesn't impact the build system finding things that ship as part of the build system. If you are attempting to build from the command line then ensure you are using the Developer Command Prompt that is part of the VS start menu folder. This sets the paths to the build system properly. Again, the path to your project is completely irrelevant. Change to your solution's directory and msbuild and it will build.

    Just to be clear though, you need to have a solution and project to do this. If you're simply trying to open a source file and "debug" it then things aren't going to work out as well and that has nothing to do with folder paths.

    0 comments No comments