【问题标题】:'Cannot find type System.Resources.ResourceSet in module CommonLanguageRuntimeLibrary' in Windows Visual Studio Local Computer SimulationWindows Visual Studio 本地计算机模拟中的“在模块 CommonLanguageRuntimeLibrary 中找不到类型 System.Resources.ResourceSet”
【发布时间】:2018-08-30 12:11:31
【问题描述】:

我正在使用 Visual Studio for Windows 开发一个应用程序。我对 Visual Studio 和 C# 非常陌生,所以我不太了解什么可以称为基础知识。 在使用外部 DLL 进行开发时,我尝试从 Windows.Forms 实现 MessageBox,当我运行程序时,此错误出现在错误列表中,

在模块 CommonLanguageRuntimeLibrary 中找不到类型 System.Resources.ResourceSet

这出现在输出中

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(354,5):Xaml内部错误错误 WMC9999:在模块 CommonLanguageRuntimeLibrary 中找不到类型 System.Resources.ResourceSet。

我试图搜索类似的问题,但我根本无法理解答案。 我该如何解决这种错误? 感谢您提供的所有帮助。

【问题讨论】:

标签: c# windows winforms visual-studio


【解决方案1】:

错误消息表示您尝试执行运行时不存在的代码。你说你试图显示一个 Windows 窗体消息框。即使在您开发应用程序时 Windows 窗体代码可用(您在 Windows 桌面上,所以它就在那里),您运行应用程序的目标无权访问 Windows 窗体代码。如果您正在编写 UWP 应用程序(用于 Windows 应用商店、Windows Phone、XBox、Windows Mixed Reality 等),则可能会发生这种情况。

大多数平台都有类似的功能。如果您实际上是在为 UWP 开发,请查看以下问题:Universal Apps MessageBox: "The name 'MessageBox' does not exist in the current context"

【讨论】:

  • 问题依然存在。由于我仅针对 Windows 进行开发,因此更改为 Windows 窗体应用程序会更好并解决问题吗?
  • 这取决于您要创建什么样的应用程序。通用 Windows 平台是最现代的 Windows 应用程序框架。 Windows 窗体实际上是围绕 User32 的包装器,这是自远古以来就存在的旧 Windows UI 框架。两者都很好。并且将一种方法调用切换到另一种方法应该不会那么困难。 :-)
  • 谢谢。我切换到表单应用程序,它运行良好,没有任何问题。 :)
猜你喜欢
  • 1970-01-01
  • 2016-11-19
  • 1970-01-01
  • 2016-04-03
  • 1970-01-01
  • 2015-10-24
  • 2019-09-20
  • 1970-01-01
  • 2013-04-15
相关资源
最近更新 更多