开发者

How to change add in file paths in VS2010

开发者 https://www.devze.com 2023-03-12 03:50 出处:网络
In VS2010 in Tools --> Options --> Environment --> Add-in/Macro Security is it possible to change the file path 开发者_StackOverflow社区variables? Or at least see where they point to?

In VS2010 in Tools --> Options --> Environment --> Add-in/Macro Security is it possible to change the file path 开发者_StackOverflow社区variables? Or at least see where they point to?

I'm trying to add a new extension but I get an error saying that the network drive is not available. I think one of these variables is pointing to a network drive that no longer exists.

For example: Where does %VSMYDOCUMENTS% point to?

Thanks


There is a list on MSDN

%ALLUSERSDOCUMENTS%       %PUBLIC%\Documents

%ALLUSERSPROFILE%         %ALLUSERSPROFILE% (defined by OS)

%APPDATA%                 %USERPROFILE%\AppData

%VSAPPDATA%               %USERPROFILE%\AppData\Roaming\Microsoft\Visual Studio\
                          --OR--
                          %USERPROFILE%\AppData\Local\Microsoft\Visual Studio\

%VSCOMMONAPPDATA%         %ProgramData%\Microsoft\Visual Studio\

%VSMYDOCUMENTS%           \Visual Studio 2010


First, addressing the first question...

...is it possible to change the file path variables

It appears the answer is no, because the VS variables are not defined in the registry nor the machine environment nor the user environment. After looking everywhere for them, I ended up replacing registry key/value pairs one by one to get the auto-generated VS folders to all show up on my preferred root folder outside of My Documents.

This is risky business changing the registry. One might break something for good. But for risk-takers one can search the following strings and adjust accordingly:

"VSMYDOCUMENTS"
"Documents\Visual Studio"
"VSMacros80"

The second one because sometimes they don't use their own variables when auto-creating folders. The third one b/c the macro folder kept showing up in odd places after I thought I had 'fixed' everything.

Jumping ahead to 2012...

Beware, the interpretation changes from version to version. For example, the MSDN link for 2010 says %VSMYDOCUMENTS% == \Visual Studio 2010. On my 2012 install I'm trying to fix this in the registry and find the following:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSEnvCommunityContent\ContentTypes\Addin\ContentHosts\2.0\Visual Studio 2012
UserDataFolder = %VSMYDOCUMENTS%\Visual Studio 2012

Which means if VSMYDOCUMENTS was the folder name created within My Documents, VS 2012 would be creating a folder \Visual Studio 2012\Visual Studio 2012.

0

精彩评论

暂无评论...
验证码 换一张
取 消