How to stop Visual Studio from automatically creat

2019-06-18 22:13发布

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.

4条回答
聊天终结者
2楼-- · 2019-06-18 22:15

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.

查看更多
你好瞎i
3楼-- · 2019-06-18 22:19

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.

查看更多
闹够了就滚
4楼-- · 2019-06-18 22:36

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.

查看更多
▲ chillily
5楼-- · 2019-06-18 22:37

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.

查看更多
登录 后发表回答