AttributeUsage给出错误 [英] AttributeUsage gives error

查看:103
本文介绍了AttributeUsage给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
[AttributeUsage(AttributeTargets.Class), AllowMultiple = false,
 Inherited = false ]
public class HelpAttribute : Attribute
{
    public HelpAttribute(String Description_in)
    {
        this.description = Description_in;
    }
    protected String description;
    public String Description
    {
        get
        {
            return this.description;
        }
    }
}


它给出错误为
"


It gives error as
"

Error   1   Syntax error, ']' expected  E:\c#\Attribute


删除错误的解决方案是什么?


What is solution to remove error?

推荐答案

将'')''''移动到最右边,在'']''之前.一切都只是方法调用的语法,带有命名或位置参数.

毕竟,为什么不简单地检查文档呢?此处:
http://msdn.microsoft.com/en-us/library/aa288454%28v = vs.71%29.aspx [ ^ ].

—SA
Move '')'' to far right, before '']''. Everything is just in the syntax for method call, with named or positional parameters.

After all, why would not you simply check the documentation? Here:
http://msdn.microsoft.com/en-us/library/aa288454%28v=vs.71%29.aspx[^].

—SA


这篇关于AttributeUsage给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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