类型列表< MyClass>的变量;不会接受默认值或绑定到OutArgument< List< MyClass>>.

编程入门 行业动态 更新时间:2024-10-28 10:26:09
本文介绍了类型列表< 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 typeList<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 youopen 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; MyCl

本文发布于:2023-11-11 11:51:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578359.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   变量   默认值   类型   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!