【问题标题】:Opening CSS file crashes Visual Studio打开 CSS 文件会使 Visual Studio 崩溃
【发布时间】:2017-06-26 09:49:01
【问题描述】:

当我使用 VS 2015 在任何 Cordova 项目中打开 CSS 文件时,它会崩溃:

遇到异常。这可能是由一个 延期。您可以通过检查文件获得更多信息 'C:\Users\a\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.

看那里显示:

Editor or Editor Extension

System.ArgumentException: The value passed in must be an enum base or an underlying type for an enum, such as an Int32.
Parameter name: value
   at System.Enum.ToObject(Type enumType, Object value)
   at Microsoft.VisualStudio.Shell.DialogPage.SetPropertyValue(PropertyDescriptor descriptor, Object automationObject, Object value)
   at Microsoft.VisualStudio.Shell.DialogPage.LoadSettingFromStorage(PropertyDescriptor prop)
   at Microsoft.VisualStudio.Shell.DialogPage.LoadSettingsFromStorage()
   at Microsoft.VisualStudio.Shell.DialogPage.set_Site(ISite value)
   at System.ComponentModel.Container.Add(IComponent component, String name)
   at System.ComponentModel.Container.Add(IComponent component)
   at Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType)
   at Microsoft.VisualStudio.Html.Package.Package.CSS.CssPackage.GetAutomationObject(String name)
   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.GetAutomationObject(String propName, Object& auto)
   at Microsoft.VisualStudio.Html.Package.Options.Common.WebSettingsStorageWithDialog.LoadFromStorage()
   at Microsoft.Web.Editor.Host.WebEditor.GetSettings(String contentTypeName)
   at Microsoft.CSS.Editor.Settings.CssSettings.get_Storage()
   at Microsoft.VisualStudio.Html.Package.TaskList.CSS.CssErrorTaskProvider..ctor(ITextView textView, ITextBuffer textBuffer)
   at Microsoft.VisualStudio.Html.Package.TaskList.CSS.CssErrorTaskProvider.Attach(ITextView textView, ITextBuffer textBuffer)
   at Microsoft.VisualStudio.Html.Package.TaskList.CSS.ErrorTaskSetup.OnTextViewCreated(ITextView textView, ITextBuffer textBuffer)
   at Microsoft.Web.Editor.Controller.TextViewConnectionListener.OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)
   at Microsoft.VisualStudio.Html.Package.Commands.CSS.VsCssTextViewConnectionListener.OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)
   at Microsoft.Web.Editor.Controller.TextViewConnectionListener.<>c__DisplayClass24_0.<OnTextViewConnected>b__0(Object sender, EventArgs eventArgs)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)

我已尝试重新启动计算机,清除 .VS 文件夹和 .user 文件。我知道我安装的唯一扩展是 Ankhsvn。

【问题讨论】:

    标签: visual-studio cordova visual-studio-cordova


    【解决方案1】:

    我在加载 CSS 文件时遇到了类似的问题。我遇到的问题是,我的 Visual Studio 与云中的设置同步。我之前安装了一个扩展,并且此设置已同步到云。当我没有扩展时,VS 仍然尝试同步设置并失败。

    我在打开 CSS 文件时总是出错,我无法打开工具-选项-文本编辑器-CSS-高级对话框。

    对我来说,以下帮助:

    1. 从 Visual Studio 注销并关闭所有实例
    2. 调用 devenv /resetuserdata
    3. 调用 devenv /resetsettings
    4. 不确定是否需要,但后来我删除了“C:\Users\XXXXXX\AppData\Local\Microsoft\VisualStudio”文件夹(下次启动时会重新创建)
    5. 启动 Visual Studio 并禁用设置“工具-选项-环境-帐户”的同步并取消选中“同步设置”
    6. 之后,您可以重新登录到您的 VS 帐户,一切都会好起来的。

    希望对你也有帮助。

    【讨论】:

    • 对我不起作用 :-( 并且丢失了我所有的 IDE 配置
    【解决方案2】:

    我在 Visual Studio 社区网站上找到了一篇对我有用的帖子。 除了在编辑 css 文件时崩溃,我还注意到这个症状:进入菜单 工具/选项/文本编辑器/CSS部分/高级显示“加载此属性页时出错”

    问题似乎是高级设置导致它崩溃。

    修复来自克里斯 https://developercommunity.visualstudio.com/content/problem/309037/my-vs-2015-crash-when-i-work-on-css-file.html?childToView=467593#comment-467593

    运行regedit,找到HKEY_CURRENT_USER\Software\Microsoft\ VisualStudio\14.0\ApplicationPrivateSettings\TextEditor\CSS 分支并删除其中的特定部分。

    如果您编辑工具/选项/文本编辑器/Css 部分/高级 它恢复被删除但这次在那里的注册表项 打开.css文件时没有错误。

    我退出了 Visual Studio,删除了上面的注册表项,启动了 Visual Studio,进入选项菜单只是为了设置几个选项(并让它重新创建密钥,以防万一),我可以打开 css 文件.

    【讨论】:

      【解决方案3】:

      看起来像是 Visual Studio 2015 中的一个错误。确保您的 Visual Studio 是最新的。如果问题在 2015 最新版本中重现,您可能需要将其报告给 https://developercommunity.visualstudio.com/spaces/8/index.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-10-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-04-20
        • 1970-01-01
        相关资源
        最近更新 更多