遇到异常。这可能是由某个拓展导致的。
问题:用vs2015打开html后会报错。
尝试:
卸载所有拓展无效。
分析:
查看日志: C:\Users\SHIHAO\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml
<time>2017/03/08 09:59:40.121</time> <type>Error</type> <source>Editor or Editor Extension</source> <description>System.ArgumentException: 传入的值必须是枚举的枚举基或基础类型,如 Int32。 参数名: value 在 System.Enum.ToObject(Type enumType, Object value) 在 Microsoft.VisualStudio.Shell.DialogPage.SetPropertyValue(PropertyDescriptor descriptor, Object automationObject, Object value) 在 Microsoft.VisualStudio.Shell.DialogPage.LoadSettingFromStorage(PropertyDescriptor prop) 在 Microsoft.VisualStudio.Shell.DialogPage.LoadSettingsFromStorage() 在 Microsoft.VisualStudio.Shell.DialogPage.set_Site(ISite value) 在 System.ComponentModel.Container.Add(IComponent component, String name) 在 System.ComponentModel.Container.Add(IComponent component) 在 Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType) 在 Microsoft.VisualStudio.Html.Package.Package.CSS.CssPackage.GetAutomationObject(String name) 在 Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.GetAutomationObject(String propName, Object& auto) 在 Microsoft.VisualStudio.Web.Editor.Package.Settings.Common.WebSettingsStorageWithDialog.LoadFromStorage() 在 Microsoft.Web.Editor.Host.WebEditor.GetSettings(String contentTypeName) 在 Microsoft.CSS.Editor.Settings.CssSettings.get_Storage() 在 Microsoft.VisualStudio.Html.Package.TaskList.CSS.CssErrorTaskProvider..ctor(ITextView textView, ITextBuffer textBuffer) 在 Microsoft.VisualStudio.Html.Package.TaskList.CSS.CssErrorTaskProvider.Attach(ITextView textView, ITextBuffer textBuffer) 在 Microsoft.VisualStudio.Html.Package.TaskList.CSS.ErrorTaskSetup.OnTextViewCreated(ITextView textView, ITextBuffer textBuffer) 在 Microsoft.Web.Editor.Controller.TextViewConnectionListener.<>c__DisplayClass26_0.<OnTextViewGotAggregateFocus>b__0() 在 Microsoft.Web.Editor.Utility.GuardedOperations.InvokeExtensionPoint(Object errorSource, Action action)</description>
查看visualstudio日志:C:\Users\SHIHAO\AppData\Local\Microsoft\VisualStudio\SettingsLogs
2017-03-09 10:44:51.2036559 Microsoft.VsHub.Server.HttpHost 12752 220 Info Poll for CrashDetection 2017-03-09 10:44:55.5417508 Microsoft.VsHub.Server.HttpHost 12752 239 Info >>> Registry Event 2017-03-09 10:44:55.5427511 Microsoft.VsHub.Server.HttpHost 12752 239 Info >>> [SigningIn] -> [be301cc0-e056-45c8-a0fc-e4199fefab4e] 2017-03-09 10:44:55.5427511 Microsoft.VsHub.Server.HttpHost 12752 239 Info >>> IdeUser Received SignedIn while OtherSigningIn 2017-03-09 10:44:55.5437521 Microsoft.VsHub.Server.HttpHost 12752 239 Info Terminated Poller CrashDetection 2017-03-09 10:44:55.5437521 Microsoft.VsHub.Server.HttpHost 12752 239 Info Initialize Offline Ide User Session 2017-03-09 10:44:55.5437521 Microsoft.VsHub.Server.HttpHost 12752 239 Info ProfileMonitor associated, Core Profile 0 Profile 0 2017-03-09 10:44:55.5437521 Microsoft.VsHub.Server.HttpHost 12752 239 Info Initiating polling for SignIn 2017-03-09 10:44:55.5437521 Microsoft.VsHub.Server.HttpHost 12752 239 Info Context state changed to SignedIn 2017-03-09 10:44:55.5447528 Microsoft.VsHub.Server.HttpHost 12752 239 Info >>> Registry Event 2017-03-09 10:44:55.5447528 Microsoft.VsHub.Server.HttpHost 12752 239 Info >>> [be301cc0-e056-45c8-a0fc-e4199fefab4e] -> [be301cc0-e056-45c8-a0fc-e4199fefab4e] 2017-03-09 10:44:55.5457531 Microsoft.VsHub.Server.HttpHost 12752 247 Info Poll for SignIn 2017-03-09 10:44:55.5457531 Microsoft.VsHub.Server.HttpHost 12752 247 Info Poll to connect (IdeUser) 2017-03-09 10:44:55.5457531 Microsoft.VsHub.Server.HttpHost 12752 247 Info Connect Async (IdeUser) 2017-03-09 10:44:55.5457531 Microsoft.VsHub.Server.HttpHost 12752 247 Info Manager ServerUri 'https://app.vssps.visualstudio.com/' 2017-03-09 10:44:55.5467545 Microsoft.VsHub.Server.HttpHost 12752 189 Info Processing context state change to SignedIn 2017-03-09 10:44:55.5477548 Microsoft.VsHub.Server.HttpHost 12752 189 Info Created Online Settings 2017-03-09 10:44:55.5477548 Microsoft.VsHub.Server.HttpHost 12752 247 Info Connector initiating silent Ide connection 2017-03-09 10:44:55.5477548 Microsoft.VsHub.Server.HttpHost 12752 189 Info Awaiting first connection attempt in WaitForFirstRefreshAsync 2017-03-09 10:44:55.5477548 Microsoft.VsHub.Server.HttpHost 12752 189 Info Wait For First Connect Attempt 2017-03-09 10:44:55.5477548 Microsoft.VsHub.Server.HttpHost 12752 189 Info Connect Async Piggyback (IdeUser) 2017-03-09 10:44:56.6788794 Microsoft.VsHub.Server.HttpHost 12752 226 Info user authentication successful for IDE user 2017-03-09 10:44:59.0435934 Microsoft.VsHub.Server.HttpHost 12752 226 Info shihao316558512@hotmail.com signed in for IDE user 2017-03-09 10:44:59.5910516 Microsoft.VsHub.Server.HttpHost 12752 226 Info Using profile polling interval from server: '1440' 2017-03-09 10:44:59.5920526 Microsoft.VsHub.Server.HttpHost 12752 226 Info Save registry identity 2017-03-09 10:44:59.5925570 Microsoft.VsHub.Server.HttpHost 12752 226 Info ProfileMonitor connected 2017-03-09 10:44:59.5925570 Microsoft.VsHub.Server.HttpHost 12752 226 Info Initiating polling for profile 2017-03-09 10:44:59.5925570 Microsoft.VsHub.Server.HttpHost 12752 226 Info Refresh Online Settings (newer than version 0) 2017-03-09 10:44:59.5925570 Microsoft.VsHub.Server.HttpHost 12752 226 Info GetProfileAttributes. Container: VisualStudio.14 Revision: 0 Scope: Application 2017-03-09 10:44:59.5930577 Microsoft.VsHub.Server.HttpHost 12752 221 Info Attempting Push Subscription 2017-03-09 10:44:59.5940580 Microsoft.VsHub.Server.HttpHost 12752 226 Info Refresh from WaitForFirstRefreshAsync 2017-03-09 10:44:59.5940580 Microsoft.VsHub.Server.HttpHost 12752 226 Info Settings refresh is piggybacked 2017-03-09 10:44:59.5945587 Microsoft.VsHub.Server.HttpHost 12752 221 Info Subscribed to Push Notifications for ProfileAttributeUpdate 2017-03-09 10:44:59.5950587 Microsoft.VsHub.Server.HttpHost 12752 221 Info Attempting Push Subscription 2017-03-09 10:44:59.5950587 Microsoft.VsHub.Server.HttpHost 12752 221 Info Subscribed to Push Notifications for ProfileCoreAttributeUpdate 2017-03-09 10:44:59.5950587 Microsoft.VsHub.Server.HttpHost 12752 221 Info Attempting Push Subscription 2017-03-09 10:44:59.5950587 Microsoft.VsHub.Server.HttpHost 12752 221 Info Subscribed to Push Notifications for ProfileUpdate 2017-03-09 10:45:00.4303007 Microsoft.VsHub.Server.HttpHost 12752 246 Info Waiting for pendingDownloadCategoriesLock in OnSettingsChangedAsync 2017-03-09 10:45:00.4303007 Microsoft.VsHub.Server.HttpHost 12752 246 Info Received Category from Server VisualStudio.14.PreferredProfile (500238) 2017-03-09 10:45:00.4332990 Microsoft.VsHub.Server.HttpHost 12752 246 Info Save roaming category PreferredProfile version 500238 2017-03-09 10:45:00.4533123 Microsoft.VsHub.Server.HttpHost 12752 246 Info Received Category from Server VisualStudio.14.Environment.Aliases (500239) 2017-03-09 10:45:00.4533123 Microsoft.VsHub.Server.HttpHost 12752 246 Info Save roaming category Environment.Aliases version 500239 2017-03-09 10:45:00.4633211 Microsoft.VsHub.Server.HttpHost 12752 243 Info Received Category from Server VisualStudio.14.Environment.KeyBindings (500240) 2017-03-09 10:45:00.4633211 Microsoft.VsHub.Server.HttpHost 12752 243 Info Save roaming category Environment.KeyBindings version 500240 2017-03-09 10:45:00.4711501 Microsoft.VsHub.Server.HttpHost 12752 40 Info Received Category from Server VisualStudio.14.Environment.FontsAndColors (500241) 2017-03-09 10:45:00.4711501 Microsoft.VsHub.Server.HttpHost 12752 40 Info Save roaming category Environment.FontsAndColors version 500241 2017-03-09 10:45:00.4781544 Microsoft.VsHub.Server.HttpHost 12752 40 Info Received Category from Server VisualStudio.14.Environment.Startup (500242)
2017-03-09 15:06:44.1538284 devenv 9676 12 Info Scenario 'Set', action 'SetValueInPrivateStore', step 'SetValueInternalAsync', setting type 'PrivateSetting', setting '_metadata.uploads.TextEditor.Html.Specific.FPACSetting.HtmlIndent',
setting value type 'System.Boolean', setting size '20':
猜测:
使用ms account登陆了vs2017,会不会是同步设置的问题
解决:
1.注销掉ms account
2.管理员运行cmd
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>devenv.exe /ResetUserData
多执行几次
欢迎大家多多交流