c# - VisualStudio UWP/XAML 设计器未显示 UserControl |由于缺少程序集,无法显示元素 "foo"

标签 c# visual-studio uwp win-universal-app uwp-xaml

我的项目文件夹中有两个项目:

  • HtSuite.UWP | Library
  • HtSuite.UWP.Leitstand | Applicaton

  • LibraryUserControl NamePasswordControl ,我可以在 XAML | Designer 中毫无问题地编辑它.

    enter image description here

    当我放置 NamePasswordControl在我的 LoginView.xaml (也在 Library 中),我收到以下错误:

    the element "passwordView" could not be displayed due to missing assemblies. After building the application, you may be able to view this control



    enter image description here

    当我运行 Application ,一切都按预期工作。

    enter image description here

    到目前为止我尝试了以下步骤(没有成功):
  • 清洁液
  • 重建项目
  • 删除缓存
  • dotnet clean
  • dotnet restore
  • 重新启动 Windows
  • 更新了 VisualStudio ( v16.6.0 ) 并尝试了 v16.7.0 预览版1

  • 有人知道如何修复预览吗?

    具有相同行为的最小测试项目:

    https://files.dominic-jonas.de/stackoverflow/ClassLibrary2.zip

    一个类库,其中有一个 UserControl 和一个应在其上显示的页面。但是,错误也显示在那里,无法预览

    日志
  • 28.05.2020 Nico Zhu - MSFT可以成功加载TestProject的预览( Visual Studio 2017 v15.9.17 )。我可以 不是 使用 vs2017 显示预览。 🤔


  • https://docs.microsoft.com/en-us/answers/questions/33146/preview-of-usercontrols-not-working-in-a-class-lib.html
  • https://developercommunity.visualstudio.com/content/problem/1052332/uwpxaml-designer-not-showing-usercontrol-the-eleme.html
  • 最佳答案

    这个问题是微软的一个bug,在developer community中讨论过。 .

    当时它是针对 Windows 10 和 VS 2017 的,据说最新版本已经修复了它。这个问题有可能在以后的版本中再次出现,所以你也应该在开发者社区发一张票。

    关于c# - VisualStudio UWP/XAML 设计器未显示 UserControl |由于缺少程序集,无法显示元素 "foo",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62042158/

    相关文章:

    c# - 无法转换属性的范围键值

    c# - UWP App 停止接收 UDP 多播消息

    button - Xamarin.Forms:在 UWP 中自定义悬停按钮样式

    c# - 避免使用自定义 ErrorHandler 类的 Try Catch 语句 - C#

    c# - 如何将 DateTime "Thu Nov 30 19:00:00 EST 2006"转换为 "11/30/2006"

    c# - OData V4 客户端代码生成器和处理 401 响应

    c# - 是否可以在 visual studio 的构建输出中使用 "collapse"内容文件路径?

    c# - 我在更新我的 ComboBox 时遇到问题,一旦我想起填充 ComboBox,我就会得到所有重复项

    c# - 在编辑器中对枚举项进行排序

    c++ - xAudio MasterVoice 取得进展