我在尝试安装/更新任何visual studio扩展时遇到错误,我在Windows 7上运行Visual Studio 2015企业版。
12/12/2016 11:35:11 AM - Microsoft VSIX Installer
12/12/2016 11:35:11 AM - -------------------------------------------
12/12/2016 11:35:11 AM - Initializing Install...
12/12/2016 11:35:11 AM - Extension Details...
12/12/2016 11:35:11 AM - Identifier : EntityFramework_Reverse_POCO_Generator..d542a934-8bd6-4136-b490-5f0049d62033
12/12/2016 11:35:11 AM - Name : EntityFramework Reverse POCO Generator
12/12/2016 11:35:11 AM - Author : Simon Hughes
12/12/2016 11:35:11 AM - Version : 2.25.0
12/12/2016 11:35:11 AM - Description : Reverse engineers an existing database and generates EntityFramework Code First POCO classes, Configuration mappings and DbContext.
12/12/2016 11:35:11 AM - Locale : en-US
12/12/2016 11:35:11 AM - MoreInfoURL : https://efreversepoco.codeplex.com/
12/12/2016 11:35:11 AM - InstalledByMSI : False
12/12/2016 11:35:11 AM - SupportedFrameworkVersionRange : [4.5,)
12/12/2016 11:35:11 AM -
12/12/2016 11:35:11 AM - SignatureState : Unsigned
12/12/2016 11:35:11 AM - References :
12/12/2016 11:35:11 AM - Signature Details...
12/12/2016 11:35:11 AM - Extension is not signed.
12/12/2016 11:35:11 AM -
12/12/2016 11:35:11 AM - Searching for applicable products...
12/12/2016 11:35:13 AM - Found installed product - Microsoft Visual Studio Enterprise 2015
12/12/2016 11:36:48 AM - The extension will be upgraded from version 2.24.0.
12/12/2016 11:36:48 AM - Found installed product - Microsoft Visual Studio Professional 2015
12/12/2016 11:36:48 AM - Found installed product - Microsoft Visual Studio Community 2015
12/12/2016 11:36:48 AM - Found installed product - Microsoft Visual Studio 2015 Shell (Integrated)
12/12/2016 11:36:48 AM - Found installed product - Global Location
12/12/2016 11:36:48 AM - Found installed product - ssms
12/12/2016 11:37:57 AM - The following target products have been selected...
12/12/2016 11:37:57 AM - Microsoft Visual Studio Enterprise 2015
12/12/2016 11:37:57 AM -
12/12/2016 11:37:57 AM - Beginning to install extension to Microsoft Visual Studio Enterprise 2015...
12/12/2016 11:37:57 AM - Upgrading 'EntityFramework Reverse POCO Generator', version 2.24.0 to version 2.25.0.
12/12/2016 11:37:59 AM - Install Error : System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.RemoveExtensionAutoUpdateSetting(String extensionIdentifier)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.UninstallInternal(IInstalledExtension extension, Boolean forceDelete)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CommitInstalledAndUninstalledExtensions(IEnumerable`1 installedExtensions, IEnumerable`1 uninstalledExtensions, IEnumerable`1 packComponentChanges)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.BeginInstall(IInstallableExtension installableExtension, Boolean perMachine, AsyncOperation asyncOp, Boolean enforceCertificateCheckForUpgrade)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallWorker(IInstallableExtension extension, Boolean perMachine, AsyncOperation asyncOp, Boolean enforceCertificateCheckForUpgrade)
12/12/2016 11:37:59 AM - Reverting uninstall of version 2.24.0 of the extension.
任何建议????
答案 0 :(得分:6)
您的MachineState.json
文件夹中是否有名为<VS2015 Install Dir>/Common7/IDE/Extensions/
的文件?如果您这样做,请尝试重命名或删除它。
查看Microsoft.VisualStudio.ExtensionManager.Implementation.dll
程序集内部,在抛出System.NullReferenceException
的函数中,它看起来像这样:
private static void RemoveExtensionAutoUpdateSetting(string extensionIdentifier)
{
AutoUpdateMachineSettings current = AutoUpdateMachineSettings.Current;
if (current.Extensions.Keys.Contains<string>(extensionIdentifier))
{
current.Extensions.Remove(extensionIdentifier);
AutoUpdateMachineSettings.Current = current;
}
}
AutoUpdateMachineSettings.Current
字段getter尝试反序列化该JSON文件,我不确定它在内部如何工作,但如果它失败时返回null
,则可能导致此异常
另一种可能性是输入extensionIdentifier
参数为null,这意味着包含扩展名的头信息的结构包含空扩展Identifier
。我能看到这种情况发生的唯一方法是,磁盘上的扩展缓存是否已损坏或损坏,或者某种方式。缓存文件位于<User Dir>/AppData/Local/Microsoft/VisualStudio/14.0/Extensions/
中,是extensions.<locale>.cache
和extensionSdks.<locale>.cache
个文件。尝试删除或重命名这些文件,然后再次尝试更新。他们会缓存文件,因此我假设当VS意识到它们不存在时,它们会安全地重建,并且我可以通过快速查看代码看出来它们只包含一堆关于已安装扩展的二进制元数据。
如果这些都不起作用,也许您可以将调试器附加到安装程序,然后提供有关抛出的异常的更多信息?
答案 1 :(得分:0)
对我来说,我将包复制到本地机器的文件夹 - &gt;为每个人提供文件共享访问权限 - &gt;点击确定 - &gt;然后安装包。