0

我将带有sharpdevelop的Vb.Net Form(以前用vb6编写)转换为c#,现在我收到错误,找不到合适的主要方法。

对此有任何解决方案吗?

最好的祝福

4

2 回答 2

1

如果您创建了一个 C# Windows 窗体应用程序,您可以在 Program.cs 中找到 Main

编辑:添加示例代码 Program.cs 示例

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication2

{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}
于 2012-04-03T08:33:18.953 回答
1

似乎您必须修复项目,或者可能使用不同的设置重新运行转换器。

一个简单的修复方法可能是:

  • 创建一个新的 WinForms 项目
  • 使用 Add Existing Item 添加您的表单
  • 使其成为主要表单(项目属性)
于 2012-04-03T08:50:48.443 回答