7

Our projects are typically stored as single projects, and are not part of a larger solution. When I open a project, Visual studio creates a solution (sln) and soution options (suo) file in my folder. I want to stop this automatic sln and suo creation, Does anybody know how to go about doing this?

EDIT: We have several dozen individual projects, and when I do a compare to source control to find the items that need to be added/checked in, these 2 are always crapping up the list for each project.

StingyJack
  • 19,041
  • 10
  • 63
  • 122
  • Does your source control system have an ignore list? – Ed S. Jan 16 '09 at 22:11
  • That'd be my suggestion too. If you're using TortoiseCVS or TortoiseSVN, just right-click on the file and check the Ignore option in the Tortoise menu. – TheSmurf Jan 16 '09 at 23:38
  • Nope. I have the ever crapulent VSS. – StingyJack Jan 17 '09 at 00:24
  • Since MS decided to re-use an acronym, i should point out that Visual Source Safe is the crapulent one, not Visual Studio Services (cloud TFS) which is pretty good. – StingyJack Jul 27 '17 at 12:12

4 Answers4

8

See if you have "Always show solution" checked under Options -> Projects and Solutions -> General. If so, uncheck it.

I believe this is unchecked by default though. I remember turning this on because I wanted solution to be created always.

Brian Kim
  • 24,916
  • 6
  • 38
  • 26
  • 2
    Good find, Brian. From the VS help file: "Always show solution When selected, the solution and all commands that act on solutions are always shown in the IDE. When cleared, all projects are created as stand-alone projects and you do not see the solution in Solution Explorer or commands that act on solutions in the IDE if the solution contains only one project." – Jannie Theunissen Dec 01 '09 at 08:25
  • 3
    I can not find this option in VS2019. Any help? – Rookian Mar 26 '20 at 16:24
2

If you're using subversion, adding the "svn:ignore" property to the folder to ignore *.sln and *.suo seems like a good solution. Other version control systems have similar functionality. Consult the docs for your specific VCS.

As for actually preventing it from happening, I have no clue, but I suspect it's impossible.

rmeador
  • 25,504
  • 18
  • 62
  • 103
2

I usually just un-check "Create directory for solution" so that it puts the SLN file in the same folder, and then I delete them by hand the first time I close the project. VS won't recreate them unless you do something solution-worthy (add a second project, for example).

There's no native way to avoid generating them.

SqlRyan
  • 33,116
  • 33
  • 114
  • 199
-2

Why bother trying to stop this? Just keep each solution to a single project, and then ignore the .sln/.suo files and open your project files as usual.

TheSmurf
  • 15,337
  • 3
  • 40
  • 48