views:

589

answers:

4

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.

+1  A: 

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.

DannySmurf
posted reasoning.
StingyJack
+2  A: 

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
I wish. Visual Source Safe 2005
StingyJack
+1  A: 

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.

rwmnau
... yes, the awful truth. Thanks anyways.
StingyJack
+1  A: 

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
Good find, Brian. From the VS help file:"<b>Always show solution</b>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."
JannieT