【问题标题】:Error when trying to view the Application Properties page in Visual Studio 2017尝试在 Visual Studio 2017 中查看应用程序属性页面时出错
【发布时间】:2019-07-29 05:13:20
【问题描述】:

当试图打开 WPF 应用程序的属性时,在应用程序页面上,它给出了以下错误:

尝试加载页面时发生错误。方法或操作未实现。

在 Windows 事件查看器中,我可以找到:

Error Information 
AppInsightsEvent Name = vs/ml/proppages/appdesigner/prop-page-designer-view-fault
Description           = ActivatePage
TelemetrySession      = '4a288b83-00d2-4f45-84cf-513352811580' Started = True OptIn=True IsInitialized = True Cloned = False
WatsonEventType       = VisualStudioNonFatalErrors2
UTC time              = 2019-03-07T10:27:40

Exception:  System.NotImplementedException  
The method or operation is not implemented. 

Microsoft.VisualStudio.Editors.PropertyPages.WPF.ApplicationPropPageVBWPF.StartupObjectOrUri.GetHashCode()
System.Collections.Hashtable.GetHash(Object key) 
System.Collections.Hashtable.InitHash(Object key, Int32 hashsize, UInt32& seed, UInt32& incr) 
System.Collections.Hashtable.ContainsKey(Object key) 
System.Windows.Forms.ComboBox.ComboBoxItemAccessibleObjectCollection.get_Item(Object key) 
System.Windows.Forms.ComboBox.ComboBoxUiaProvider.SetComboBoxItemSelection()
System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e) 
System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value) 
System.Windows.Forms.ComboBox.set_SelectedItem(Object value) 
Microsoft.VisualStudio.Editors.PropertyPages.WPF.ApplicationPropPageVBWPF.SetSelectedStartupObjectOrUriIntoCombobox(ComboBox combobox, StartupObjectOrUri startupObjectOrUri) 
Microsoft.VisualStudio.Editors.PropertyPages.WPF.ApplicationPropPageVBWPF.SetStartupObjectOrUriIntoUI(Control control, PropertyDescriptor prop, Object value) 
Microsoft.VisualStudio.Editors.PropertyPages.PropertyControlData.InitPropertyUI()
Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase.InitPage()
Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase.SetObjects(Object[] objects) 
Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase.IPropertyPageInternal_SetObjects(Object[] objects) 
Microsoft.VisualStudio.Editors.PropertyPages.PropPageBase.Create(IntPtr hWndParent) 
Microsoft.VisualStudio.Editors.PropertyPages.PropPageBase.IPropertyPage2_Activate(IntPtr hWndParent, RECT[] pRect, Int32 bModal) 
Microsoft.VisualStudio.Editors.PropPageDesigner.PropPageDesignerView.ActivatePage(IPropertyPage PropPage)

我的尝试

  • 我之前安装了 Visual Studio 2019 RC,但现在已将其卸载。该版本也给出了同样的错误。
  • 重新安装 Visual Studio 2017 没有帮助。
  • 这发生在旧项目和新创建的项目中。
  • 我的同事在他的计算机上没有相同的项目。
  • 上周我没有遇到任何问题。我没有安装/卸载任何特别的东西。

【问题讨论】:

  • 听起来 VS 2019 已经替换了 VS 2017 正在使用的文件,但现在你被它困住了。我所能建议的就是尝试找出是什么文件,然后用一个好的文件替换它,可能是从你同事的电脑上复制的。您可以比较您机器上的文件和他们的文件,以确定存在哪些差异。这会很痛苦,但如果重新安装 CS 2017 也无济于事,这可能是必要的。
  • 我之前能够访问该页面,当时安装了两个版本。

标签: wpf vb.net visual-studio visual-studio-2017 .net-4.7.2


【解决方案1】:

修复:更新到最新版本的 Visual Studio 2017 - 15.9.19+

看来这只是.vbproj 项目类型的问题。

这也被报道在:

【讨论】:

    【解决方案2】:

    我在使用 Visual Studio 2017 15.9 时遇到了这个问题。我安装了旧版本的 Visual Studio (15.6),问题就消失了。

    安装较早版本的 Visual Studio 2017:https://docs.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017

    【讨论】:

    • 好消息!似乎有一个修复程序可以将版本向前滚动到 15.9.19 而不是回到 15.6
    【解决方案3】:

    我只是打开 *.csproj 文件并将 TargetFrameworkVersion 更改为 v4.7.5 并部分解决了问题。我的项目最初是在 .NET 3.5 下开发的。现在应用程序选项卡打开,但不编译。我可以更改所需的属性,然后将目标版本更改回编译项目。当然,这不是解决方案。 PS。解决方法在这里:https://developercommunity.visualstudio.com/content/problem/549137/known-issue-application-tab-of-vb-project-property.html

    【讨论】:

      【解决方案4】:

      我找到了这个解决方案: 请执行以下操作来解决您的问题:

      • 退出 VS 2017

      • 启动 VS 2017 安装程序。

      • 点击修改。

      • 检查“.NET 桌面开发”工作负载。如果选中,请取消选中,然后在第二次运行中检查(卸载 - 安装)

      • 点击修改。

      • 重新加载您的项目

      【讨论】:

        猜你喜欢
        • 2019-02-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-16
        相关资源
        最近更新 更多