尝试在 VS 2015 中安装 Visual Studio 扩展时出现 NullReferenceException

NullReferenceException when trying to install Visual Studio extension in VS 2015

所以我正在尝试在 Visual Studio 2015 年安装我的 Visual Studio 扩展程序,但在尝试时出现此安装错误:

System.NullReferenceException: Object reference not set to an instance of an object

奇怪的是我调试的时候可以运行实验实例中的扩展

这在安装日志中:

Beginning to install extension to Microsoft Visual Studio Professional 2015...
Install Error : System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CheckForValidDotNetFramework(IExtension extension)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CheckForInstallBlockers(InstallableExtensionImpl extension, IInstalledExtensionList modifiedInstalledExtensionsList, Boolean isNestedExtension, Boolean& olderVersionInstalled)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallInternal(InstallableExtensionImpl extension, Boolean perMachine, Boolean isNestedExtension, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, AsyncOperation asyncOp, UInt64 totalBytesToWrite, UInt64& totalBytesWritten, Boolean enforceCertificateCheckForUpgrade)
   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)

我已经尝试过的事情:

请帮忙

好吧,现在我检查了 ExtensionManager.Implementation,并且从 CheckForValidDotNetFramework 方法中我发现没有为扩展设置 .NET Framework 的版本范围。我可以在 Dependencies 下的 source.extension.vsixmanifest 中设置它,在将 .NET 框架更改为所有项目上的 Version range 后,我在条目的 [4.6.1] 中输入 [4.6.1]

如果日志中的错误消息说 哪个 对象为空,那将会很有帮助。