193

When I open my solution by double click on solution file in a file manager, Visual Studio 2012 asks me whether I want to save devenv.sln: enter image description here

How can I avoid this annoying thing? (except of opening vs first and than solution - I want just to click a solution file in my file manager).

dthrasher
  • 40,656
  • 34
  • 113
  • 139
Dmitry Khryukin
  • 6,408
  • 7
  • 36
  • 58
  • 1
    Which file is `devenv.sln`? Are you opening project files directly without them being associated with a solution file? Are you using VS to debug running processes or crash dump files without access to the source code? – Dai Nov 28 '12 at 01:45
  • 1
    @Dai 1 question: devnv is a process which belongs to VS. have no idea what devenv.sln is. 2 question: no. 3 qustion: no. – Dmitry Khryukin Nov 28 '12 at 03:22
  • 2
    looks like I've found a solution - http://social.msdn.microsoft.com/Forums/en/vssetup/thread/8716b5e9-0565-459e-8970-93db52cab466 will check later – Dmitry Khryukin Nov 28 '12 at 03:24
  • 1
    I also experienced this after I had set devenv.exe to run as administrator in the compatibility tab. After also setting the vslaucher.exe to run as administrator (as suggested here) the problem was resolved. – Bruno Aug 21 '13 at 11:33

2 Answers2

315

As indicated here, you have to configure "C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\vslauncher.exe" to run as Administrator.

  1. Right-click C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VSLauncher.exe
  2. Select Properties
  3. Click Compatibility
  4. Set "Run this program as an administrator".

I also did the same for C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe.

Rami A.
  • 10,302
  • 4
  • 44
  • 87
  • Which other versions of Visual Studio do you have installed, if any? If more than one, did you install them in order of their version where Visual Studio 2012 was installed last? – Rami A. Jan 22 '13 at 01:19
  • I have VS 2008-2012. yes, I installed them in order of the versions. – Dmitry Khryukin Jan 22 '13 at 20:42
  • 3
    Did you install Visual Studio 2012 Update 1? When I right-clicked on "C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VSLauncher.exe" > Properties > Compatibility > and set "Run this program as an administrator", double-clicking a VS2010 and VS2012 sln files in Windows Explorer works as expected. I also did the same for "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe". You may want to double-check both exes to make sure that setting was saved correctly. – Rami A. Jan 22 '13 at 21:56
  • A note to those coming from the msdn link in this answer (that now links to this stackoverflow post) - this answer worked for me without having to do any of the registry editing mentioned - just make this one change and it will fix the problem. – Adam Knights Mar 10 '15 at 08:48
  • Yes i start as administrator, but i always want to start it as administrator, how can i fix this then? – Joel Harkes Nov 09 '15 at 14:00
  • @joelharkes, I've updated my answer to include brief instructions. – Rami A. Nov 09 '15 at 17:37
  • @Jono_2007: Works for VS2015. Self confirmed. – Nikhil Agrawal Sep 05 '16 at 09:41
  • Such a crazy fix but it works on Winserver 2012 R2 as well! – Josh P Mar 06 '17 at 21:59
  • Confirming this for VS17 – Mese Apr 27 '17 at 09:03
  • Doesn't sound like a good idea to me to always run your IDE as an administrator... – Enrico Apr 04 '19 at 12:45
  • Works for VS22. – Elanor-L Dec 07 '21 at 08:59
2

Another option, a bit less obvious, is to save the devenv.sln file to the Visual Studio IDE folder for that version of Visual Studio. This was an option described in the link noted above.

Probably not the best option, but it is an option none the less.

John Baughman
  • 843
  • 1
  • 8
  • 11
  • This seems to be the quickest and for me the safest way, as I don't want to always open all sln files with admin. – mickeymicks Oct 14 '20 at 02:37