类型列表< MyClass>的变量;不会接受默认值或绑定到OutArgument< List< MyClass>>. [英] Variable of Type List<MyClass> won't accept default value or binding to OutArgument<List<MyClass>>

查看:55
本文介绍了类型列表< MyClass>的变量;不会接受默认值或绑定到OutArgument< List< MyClass>>.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是在重新托管的设计器中...
如果我声明类型为List< MyNamespace.MyClass>的变量MyList,并尝试将默认值设置为New List(Of MyNamespace.MyClass )()我收到一个验证错误:
在处理表达式'New List(Of MyNamespace.MyClass)()'时遇到编译器错误. 类型'MyClass'未定义.

如果尝试将变量绑定到Activites OutArgument< List< MyClass>> ;,也会遇到相同的错误.

这是一个错误吗?

This is in a rehosted designer...
If I declare a variable MyList of type List<MyNamespace.MyClass>, and try to set the default value to New List(Of MyNamespace.MyClass)() i get a validation error:
"Compiler error encountered processing expression 'New List(Of MyNamespace.MyClass)()'.  Type 'MyClass' is not defined." 

I get this same error if I try to bind the varable to an Activites OutArgument<List<MyClass>>.

Is this a bug?

推荐答案

您好,您可以打开Imports设计器并查看MyNamespace是否存在导入吗?如果不是,那么您需要在执行操作之前显式添加导入(编译器使用序列化的名称空间/程序集对进行名称解析).

谢谢

Hi, can you open the Imports designer and see if there is an import for MyNamespace? If not, then you need to explicitly add the import before you can proceed (the compiler uses a serialized namespace/assembly pair for name resolution).

Thanks


这篇关于类型列表&lt; MyClass&gt;的变量;不会接受默认值或绑定到OutArgument&lt; List&lt; MyClass&gt;&gt;.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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