Wpf 用户控件测试容器:程序集不包含任何用户控件

Wpf 用户控件测试容器:程序集不包含任何用户控件,wpf,vb.net,xaml,Wpf,Vb.net,Xaml,这简直要了我的命。我正在尝试使用User Control test Container.exe在Visual Studio 2010中测试/调试WPF UserControl库。我不断得到错误程序集[…]不包含任何UserControls。这应该很简单,我看过的每一篇msdn文章和博客教程都表明,它应该完美而神奇地工作 下面是一个我无法实现的非常简单的测试用例的代码: XAML: 项目文件的调试选项设置为打开UserControlTestContainer.exe,命令行参数为./MyTestL

这简直要了我的命。我正在尝试使用User Control test Container.exe在Visual Studio 2010中测试/调试WPF UserControl库。我不断得到错误程序集[…]不包含任何UserControls。这应该很简单,我看过的每一篇msdn文章和博客教程都表明,它应该完美而神奇地工作

下面是一个我无法实现的非常简单的测试用例的代码: XAML:

项目文件的调试选项设置为打开UserControlTestContainer.exe,命令行参数为./MyTestLibrary.dll


关于如何实现这一点有什么建议吗?

可以肯定的是,您的用户控件被托管在一个窗口或其他地方,对吗?我非常确定您不能单独显示usercontrol。包含窗口的外观如何?

仅适用于使用Windows控件库项目模板生成的库。即使是这样,它也是一个子集,因为VisualC++控件不能使用它来测试。< / P>不,我没有包含窗口,但我认为这是用户控件测试容器的全部要点。它是一个WPF用户控制库,不是WPF应用程序,因此没有主功能,但据我所知,UCTC生成一个窗口,这样您就可以单独测试UC组件,而不必启动整个应用程序。我错了吗?刚才注意到在exceptionSystem.ArgumentException:Assembly./WpfControlLibrary\u Tutorial1.dll中不包含任何用户控件类型。在Microsoft.VisualStudio.Tools.UserControlTestContainer.UserControlTestContainer\u LoadObject sender,System.Windows.Forms.Form.OnLoadEventArgs e…等处,UCTC仅使用表单命名空间,而不使用WPF命名空间。我将把这一点理解为UCTC只设计用于WinForms UserControls,而不是WPF UserControls。谢谢你浪费了我三天的生命,微软。
<UserControl x:Class="UserControl1"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">
<Grid>
    <Label Content="Hello!" Height="28" HorizontalAlignment="Left" Margin="86,106,0,0" Name="Label1" VerticalAlignment="Top" />
</Grid>
Public Class UserControl1
Inherits UserControl

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

End Class