在 Visual Studio Professional 2019 中,如何更改公共扩展目录?

问题描述 投票:0回答:1

我正在将 Visual Studio 2019 的安装从 G:\ 迁移到 L:...,移动所有引用时几乎没有任何问题。除了一些“扩展”和一些项目。更改所有引用后,我可以在“Regedit”和复制的目录中找到。我一定还错过了什么。要检查我是否成功:我特意将“G:”驱动器子目录从“Extensions”重命名为 '...\Microsoft Visual Studio�9\Professional\Common7\IDE\Extensions_old'。完成此操作后,我在 ActivityLog.xml 中收到类似这样的错误

<entry>
<record>675</record>
<time>2023/10/30 14:36:16.637</time>
<type>Error</type>
<source>VisualStudio</source>
<description>CreateInstance failed for package [UnityPackage]Source: &apos;mscorlib&apos; Description: Could not load file or assembly &apos;file:///g:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\visual studio tools for unity\SyntaxTree.VisualStudio.Unity.dll&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;System.IO.FileNotFoundException: Could not load file or assembly &apos;file:///g:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\visual studio tools for unity\SyntaxTree.VisualStudio.Unity.dll&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;
file:///g:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\microsoft\visual studio tools for unity\SyntaxTree.VisualStudio.Unity.dll&apos;&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
<guid>{B6546C9C-E5FE-4095-8D39-C080D9BD6A85}</guid>
<hr>80004005 - E_FAIL</hr>
<errorinfo></errorinfo>
我不想重新安装一切。我试图找到一种更简单的方法。我希望这只是对类似文本文件的更改。我正在放弃“G”驱动器。
visual-studio visual-studio-2019 visual-studio-extensions
1个回答
0
投票

对我来说,真正的答案是确保 VS 已关闭。 1) {Windows-10} 使用右键单击 Windows 图标。单击“磁盘管理”。 2) 将我的“G”驱动器盘符更改为“W”。 3) 将我的“L”驱动器盘符更改为“G”。

这样就有效地使“L”驱动器成为“G”驱动器。然后我已经将注册表项混入了“L”驱动器并弄乱了我的“缓存”。我必须纠正上面评论中造成的所有损害。我将注册表中的所有引用改回“G”,任何发现此内容的人......“请忽略该部分......”。事实上,任何发现此问题的人唯一要做的可能就是上面的“磁盘管理”步骤。所以我不得不删除该文件夹: \Users{用户}\AppData\Local\Microsoft\VisualStudio .0_xxx 在我的例子中是“16.0_5672de2b”。然后,当我重新启动 VS 时,它说它必须重新启动才能“首次使用”...但随后它加载正常。包括上面失败的“Unity”项目。

© www.soinside.com 2019 - 2024. All rights reserved.