带有自定义泛型类的VS 2012中的标记错误无效 [英] Invalid Markup Error in VS 2012 with custom generic class

查看:78
本文介绍了带有自定义泛型类的VS 2012中的标记错误无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Win8发布上使用VS 2012 预习。每当我打开下面的XAML文件时,我都会收到以下错误。 Designer窗口显示错误"无效标记"。并且错误列表包含以下错误。



1)名称"ViewBase"命名空间中不存在"clr-namespace:MyViewBaseClassExample; assembly = GenericViewBaseClass"。

$
2)属性"TypeArguments"在"http://schemas.microsoft.com/winfx/2006/xaml""中不存在命名空间



XAML文件:



< local:ViewBase x:Class =" ViewBaseClassExample.Color" ; $
             xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"

           &NBSP;&NBSP; xmlns:x =" http://schemas.microsoft.com/winfx/2006/xaml"

           &NBSP;&NBSP;的xmlns:MC = QUOT; HTTP://schemas.openxmlformats.org/markup-compatibility/2006"


             xmlns:d =" http://schemas.microsoft.com/expression/blend/2008"

           &NBSP;&NBSP; xmlns:local =" clr-namespace:MyViewBaseClassExample; assembly = GenericViewBaseClass"

             x:TypeArguments =" local:ColorData"

             MC:可忽略= QUOT; d"


             d:DesignHeight = QUOT; 65 QUOT; d:DesignWidth =" 300">

    < Grid Height =" 100">

     ;     < local:MySelectionUserControl x:Name =" ColorFeature" />

    < / Grid>

< / local:ViewBase>



后面的代码:



  ;   公共部分类颜色:ViewBase< ColorData>

     {

      ;    public Color()

         {

              InitializeComponent();

        }

    }



代码编译并运行正常,但我无法在设计器中看到控件UI。奇怪的是,这在VS 2010中运行良好。

I'm using VS 2012 on Win8 Release  Preview. I get the following errors whenever I open the below XAML file. The Designer window displays the error "Invalid Markup". And the error list contains the following errors.

1) The name "ViewBase" does not exist in the namespace "clr-namespace:MyViewBaseClassExample;assembly=GenericViewBaseClass".

2) The property "TypeArguments" does not exist in the "http://schemas.microsoft.com/winfx/2006/xaml" namespace

XAML file:

<local:ViewBase x:Class="ViewBaseClassExample.Color"
             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"
             xmlns:local="clr-namespace:MyViewBaseClassExample;assembly=GenericViewBaseClass"
             x:TypeArguments="local:ColorData"
             mc:Ignorable="d"
             d:DesignHeight="65" d:DesignWidth="300">
    <Grid Height="100">
        <local:MySelectionUserControl x:Name="ColorFeature"/>
    </Grid>
</local:ViewBase>

The code behind:

    public partial class Color : ViewBase<ColorData>
    {
        public Color()
        {
            InitializeComponent();
        }
    }

The code compiles and runs fine, but I can't see the control UI in designer. Strangely this works fine in VS 2010.

推荐答案

感谢您报告此问题。您可以将repro项目发送到
harikm@microsoft.com

Thanks for reporting this issue. Can u please send the repro project to harikm@microsoft.com.


这篇关于带有自定义泛型类的VS 2012中的标记错误无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆