我正在从vb.net应用程序迁移到c#,我用this工具来转换所有我的代码方法的方法。但是当我最终编译代码时,我找不到合适的方法来覆盖。没有合适的方法发现覆盖从vb.net转换为c#
我看着这个类似的帖子No Suitable Method Found To Override
但他使用部分类,但我使用一个内部类 frmMain.cs代码
namespace RSCWebPoll
{
internal class frmMain : System.Windows.Forms.Form
{
const bool IsDebug = false;
const short LoopTimeInSeconds = 300;
public TFSUtilities.Logger logger = new TFSUtilities.Logger();
public System.DateTime NextPollTime;
public string WinDSSStoreName;
public string WinDSSStoreNumber;
public string WinDSSStoreCity;
public string WinDSSStoreState;
public string WinDSSRegisterNumber;
public string WinDSSTillNumber;
public string WinDSSDrawerNumber = "1";
public short RegisterStatus;
public string TillSeqType;
}
}
frmMain.Designer.cs
partial class frmMain
{
#region "Windows Form Designer generated code "
[System.Diagnostics.DebuggerNonUserCode()]
public frmMain()
: base()
{
//This call is required by the Windows Form Designer.
InitializeComponent();
}
//Form overrides dispose to clean up the component list.
[System.Diagnostics.DebuggerNonUserCode()]
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
}
个
我怀疑你的部分类是在不同的命名空间,所以他们没有得到链接在一起。 –
是的,您的frmMain.Designer.cs没有粘贴到此问题中的名称空间。你是否在那个文件中四处游走?它是由VS生成的,所以你不应该碰它。 – Will
命名空间和表单类需要在cs文件和designer.cs文件中相同。此外,项目设置中的默认名称空间必须与cs文件中的名称空间相匹配。 – jdweng