具有字符串参数的主方法入口点给出“不包含...合适的...入口点".错误 [英] Main method entry point with string argument gives "does not contain ... suitable ... entry point" error

查看:29
本文介绍了具有字符串参数的主方法入口点给出“不包含...合适的...入口点".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么下面的代码块会给出不包含适用于入口点的静态'Main'方法"的编译错误?

Why does the code block below give a compile error of "does not contain a static 'Main' method suitable for an entry point"?

namespace MyConApp
{
    class Program
    {
        static void Main(string args) 
        {
            string tmpString; 
            tmpString = args;
            Console.WriteLine("Hello" + tmpString);
        }
    }
}

推荐答案

请参见

See this to understand Main method signature options.

这篇关于具有字符串参数的主方法入口点给出“不包含...合适的...入口点".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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