7

Every time I launch Visual Studio 2010, it creates a directory called "Visual Studio 2010" in the current working directory at the time I launched it. It just started doing this at the same time that it forgot all of my toolbar settings and so on.

I've clearly got an incorrect setting somewhere, but I can't find it.

Under Tools\Options\Projects and Solutions\General I have:

Projects location:
D:\ian

User project templates location:
M:\Visual Studio 2010\Templates\ProjectTemplates

User item templates location:
M:\Visual Studio 2010\Templates\ItemTemplates

How do I stop this spurious .\Visual Studio 2010 directory being created and tell it to use the proper one on M:\ instead?

Edit: Since I've started a bounty on this, please be reasonable and don't post a suggestion that doesn't answer the question. For example, don't say 'Have you tried reinstalling?' or 'Have you tried deleting all your settings?' Thank you for your understanding.

Ian Goldby
  • 5,609
  • 1
  • 45
  • 81
  • What is the contents of the folder that is created each time ? – Adrian Fâciu Jan 19 '12 at 12:07
  • Thank you to the anonymous drive-by down-voter. I presume you considered the answer so obvious that you would not stoop to submitting it here and collecting the bounty. – Ian Goldby Jan 23 '12 at 13:19

6 Answers6

6

Damn, too annoying. You don't know which plugin/addon or something do this...

So we can't find it too* Ok. thanks god, stackoverflow is here... Here is the solution;


Press Win + R

Type "regedit"

Go to this folder by treeview; "[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0]"

Edit everything which are like this; "Documents\Visual Studio 2010\"

Last step; In registry editor, press Ctrl + F

Search the string "Documents\Visual Studio 2010\". And change them too if anything appears...

I suggest an advanced registry editor for this.

Good luck & best regards...

UPDATE:

And if you still have the problem; open VS2010, go to "tools" > click "extension manager" > try to disable all plugins(I mean all of them). And play with VS again, create a new project etc. If there will be created a new folder( named like "Visual Studio 2010" ) in the "documents" then we will sure this comes from the ide:visual studio 2010( not add-ons ). Also, if you are using a "subversion control software" or "sdk service" try to disable them too... ( with disabling services in OS management )

Lost_In_Library
  • 3,265
  • 6
  • 38
  • 70
  • Thanks. I've tried your suggestion but unfortunately I've still not found the key/value that is causing the problem. I am now certain it is not any of those in [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0]. – Ian Goldby Jan 20 '12 at 10:58
  • you are using vs2010, am I right? So, did you try to search "Documents\Visual Studio 2010\" or "Documents\Visual Studio 10\" in registry? Default registry editor(ms) gui and functions are not very well. Try to use this software; http://www.torchsoft.com/en/rw_information.html and please check my updated answer... – Lost_In_Library Jan 20 '12 at 11:50
  • Neither "Documents\Visual Studio 2010\" nor "Documents\Visual Studio 10\" exist in the Registry. I disabled my one (and only) Extension (Microsoft All-In-One Code Framework) but that didn't solve it. The "Visual Studio 2010" directory appears as soon as I launch Visual Studio (by opening a .sln file from Windows Explorer). In fact I get two: one in the same directory as the .sln file and one in the parent directory. – Ian Goldby Jan 20 '12 at 15:37
  • Ok, sorry to hear that... I have just one more try; http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/e95ca440-483b-4213-bf4a-6504acd5716c/ Same problem, same suggestions... – Lost_In_Library Jan 20 '12 at 15:56
  • OK, I got there in the end. Your link led to [this](http://stackoverflow.com/questions/442586/visual-studio-2008-backup-files-folder-created-when-every-new-vs-instance-is-ope), which answered the question. I was wrong in my first comment. It was in fact HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\ **VisualStudioLocation** but after setting it I got an error the next time I started Visual Studio that it had lost my settings file. Turns out I had to ignore that error - my settings file was fine and it solved the problem. – Ian Goldby Jan 23 '12 at 13:14
  • Damn. That wasn't the fix after all. The path I put there was a UNC path, and the result was it created a set of directories one inside the next at the root of the current drive. It seems VisualStudioLocation is treated as a *relative* path, but relative to what exactly? All I want is my default project location on the C: drive and my settings on a network drive. – Ian Goldby Jan 25 '12 at 08:32
  • This is doesn't matter but default project location will be on C: drive or D: drive ? ( You wrote D: drive in your main question. ) – Lost_In_Library Jan 25 '12 at 08:41
  • It was D, but I changed it to C a month ago when my D drive stopped working. – Ian Goldby Jan 25 '12 at 08:53
  • I had a final go at solving it by exporting my settings, deleting all of the path-related keys in [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0], then restarting VS2010 and re-importing my settings. That seems to have worked - for now. It may be the problem was what I had in Tools\Options\Environment\Import and Export Settings\Automatically save my settings to this file. But I wasn't importing or exporting the settings when the spurious folder was created. Too confusing! – Ian Goldby Jan 25 '12 at 08:56
  • So Ian, you are a programmer; write a well-optimized windows service which is check the "visual studio folder" that is created in every openings - and give a command in your service to delete it. That's the last thing I imagine. – Lost_In_Library Jan 25 '12 at 08:58
2

This is the final answer that worked for me.

It turns out that Visual Studio 2010 regularly and automatically exports your settings file. (You would probably expect it to save your settings on exit, but not export them unless you explicitly ask it to.) I think it does this every time you quit, but it seems to create the directory into which it will export as soon as it is launched. This is the problem I was seeing.

This is how I resolved it:

Tools > Options > Environment > Import and Export Settings

The field Automatically save my settings to this file: was just Visual Studio 2010\Current Settings.vssettings. This is a relative path, so the folder Visual Studio 2010 was being created in the current working directory. I changed it to an absolute path M:\Visual Studio 2010\Current Settings.vssettings and this solved the problem.

Ian Goldby
  • 5,609
  • 1
  • 45
  • 81
1

This is another different way, so I'm adding a new answer here. I don't want to edit my previous answer too much( It's started to looks ugly )...

Just go that link, download/copy the script, carefully save and edit for your needs; https://github.com/jerker-back/VSUtilities/blob/master/custom_vspaths.js and run it under admin.user.rights( or disable windows uac )...

Lost_In_Library
  • 3,265
  • 6
  • 38
  • 70
0

None of the solutions here worked for me. I don't think we've seen the golden bullet yet.

I had been writing to the same settings folder for years and all of a sudden that was no good for visual studio anymore. The folder was a networked folder. One day, every time I fired up a solution it would start making me yet another Visual Studio 2010 folder in the same directory as the .sln file.

I tried (and re-tried) specifying where settings are saved. I also went through and did some registry changes. In the end, what seemed to fix it was to re-config the IDE to use a local path, and then re-config it again to use the network path. I did this for all the paths you can set in Tools...Options...Environment...Import and Export Settings as well as Tools...Options...Environment...Projects and Solutions...General. And now I'm back to the setup I've been using for the last few years. It has stopped creating new folders every time I open a solution. For now, anyway.

edhubbell
  • 2,218
  • 1
  • 16
  • 17
0

The brute-force solution:

  1. Run regedit and rename the folder [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio] to something like "VisualStudio_BAK".
  2. Run devenc.exe /resetsettings to reset all settings to default.

If you don't know what you are doing, don't try this...! ;-)

Mayeenul Islam
  • 4,532
  • 5
  • 49
  • 102
0

Is it possible that you have a macro in your EnvirommentEvents that is causing this? Go to menu Tools -> Macros -> Macros IDE. Look in each of the macros trees in the Project Explorer for EnvironmentEvents to see if any of those macros is the culprit.

GaTechThomas
  • 5,421
  • 5
  • 43
  • 69