簡體   English   中英

管理Nuget軟件包崩潰VS2017

[英]Manage Nuget Packages crashes VS2017

每次添加Nuget Reference時,我都會遇到Visual Studio崩潰。 這感覺就像一個BUG。

它被開發者社區(測試版)網站報告: https//developercommunity.visualstudio.com/content/problem/6782/manage-nuget-packages-crashes-vs2017rc.html

它聲明它是固定的,因此確切的根本原因必須是不同的:

在此輸入圖像描述

問題看起來像是在2015年存在但沒有答案: Nuget Package Manager在單擊“管理nuget包以獲得解決方案”Visual Studio 2015時崩潰

它非常煩人我必須使用控制台手動安裝軟件包或編輯packages.config文件,然后恢復軟件包。 不開心 - 有沒有人有解決方案?

眼鏡
Win7 x64
Microsoft Visual Studio Enterprise 2017
版本15.2(26430.6)發布
VisualStudio.15.Release / 15.2.0 + 26430.6
Microsoft .NET Framework v 4.7.02053

已安裝版本:企業版

.....

NuGet Package Manager 4.2.0


事件日志:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Shell.Settings.ShellWritableSettingsStore.CreateCollection(String collectionPath)
   at Microsoft.VisualStudio.PlatformUI.CategoryMRUItems.SaveItems(WritableSettingsStore store)
   at Microsoft.VisualStudio.PlatformUI.MRUItemsStoreService.AddMRUItem(Guid& guidCategory, String lpszItem)
   at Microsoft.VisualStudio.PlatformUI.MruItemsStoreServiceDecorator.AddMRUItem(Guid& guidCategory, String lpszItem)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowSearchHost.Microsoft.VisualStudio.Platform.WindowManagement.IWindowSearchEventsHandler.OnAddMRUItem(String searchedText)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowSearchDataSource.OnAddMRUItem(String searchedText)
   at Microsoft.VisualStudio.PlatformUI.SearchControlDataSource.AddMRUItemAction(GelDependencyObject datasource, Object parameter)
   at Microsoft.Internal.VisualStudio.PlatformUI.GelDependencyObject.Invoke(GelVerb descriptor, Object param)
   at Microsoft.Internal.VisualStudio.PlatformUI.GelDependencyObject.Invoke(String verb, Object param)
   at Microsoft.Internal.VisualStudio.PlatformUI.GelDependencyObject.Invoke(String verb, Object pvaIn, Object& pvaOut)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
   at Microsoft.Internal.VisualStudio.PlatformUI.Utilities.Invoke(Microsoft.VisualStudio.Shell.Interop.IVsUIDataSource, System.String, System.Object)
   at Microsoft.VisualStudio.PlatformUI.SearchControl.AddToMRUItems(System.String)
   at Microsoft.VisualStudio.PlatformUI.SearchControl.SearchBox_LostKeyboardFocus(System.Object, System.Windows.Input.KeyboardFocusChangedEventArgs)
   at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   at System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject, Int32)
   at System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject, System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean, Boolean)
   at System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject, Boolean, Boolean, Boolean)
   at System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement)
   at System.Windows.UIElement.Focus()
   at System.Windows.Controls.ListBoxItem.HandleMouseButtonDown(System.Windows.Input.MouseButton)
   at System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.UIElement.OnMouseLeftButtonDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
   at System.Windows.UIElement.OnMouseDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.ContentElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

Faulting application name: devenv.exe, version: 15.0.26430.6, time stamp: 0x5914d7fe
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23807, time stamp: 0x5915f98e
Exception code: 0xe0434352
Fault offset: 0x0000c54f
Faulting process id: 0xf48
Faulting application start time: 0x01d2fb77b5f33dcc
Faulting application path: C:\Program Files x86\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe
Faulting module path: C:\WINDOWS\syswow64\KERNELBASE.dll
Report Id: f949036c-676b-11e7-8422-3417ebddc764

Error Handler Exception: System.ServiceModel.CommunicationException: There was an error reading from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error reading from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.PipeException: There was an error reading from the pipe: Unrecognized error 109 (0x6d).
   at System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
   --- End of inner exception stack trace ---
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)
   at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
   --- End of inner exception stack trace ---
   at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)
   at System.ServiceModel.Channels.StreamConnection.EndRead()
   --- End of inner exception stack trace ---
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
   at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext) \r\n    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
   at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)

我使用SysInternals Process Monitor找出當VS嘗試使用RegCreateKey獲取密鑰時發生的實際ACCESS_DENIED

\REGISTRY\A\{4B5F9AD2-BB8B-4CF8-9ACB-201C56F4D086}\Software\Microsoft\VisualStudio\15.0_05fc10d7\MRUItems\{00000000-0000-0000-0000-000000000000}\Items

此密鑰似乎存儲在VS應用程序配置單元文件中:

C:\Users\<user name>\AppData\Local\Microsoft\VisualStudio\15.0_05fc10d7\privateregistry.user.bin

我開始使用regedit作為管理員,將hive文件加載到regedit中,如下所述

  1. 啟動RegEdit.exe
  2. 在左側窗格中選擇Computer \\ HKEY_LOCAL_MACHINE節點
  3. 選擇文件| 加載Hive ...菜單項,並加載privateregistry.user.bin
  4. 當提示輸入密鑰名稱時,只需鍵入“VSRegHive”之類的內容
  5. 這會將數據加載到HKLM節點下的VSRegHive中
  6. 創建2個缺席密鑰{00000000-0000-0000-0000-000000000000}\\Items

在此輸入圖像描述

  1. 完成后,選擇VSRegHive並選擇File | 卸載Hive ...,在退出RegEdit.exe實用程序之前,否則VS將無法啟動。 保持hied加載在hgedit中會產生某種阻止DevEnv.exe啟動的鎖定。

由於缺少2個密鑰,VS2017在NuGet管理器中不會崩潰。

我的VS2017也在NuGet包管理器中崩潰,所以我無法將包添加到項目中。 嘗試以管理員身份啟動VS2017,我可以通過這種方式添加軟件包,然后以普通用戶身份重新啟動VS2017。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM