2012-03-26 80 views
0

我写这运行正常在模拟器一个简单的“Hello World”应用程序,但是当我试图将其部署到它生成的代码崩溃的设备:无法部署到Windows Mobile设备

private void InitializeComponent() 
{ 
    this.mainMenu1 = new System.Windows.Forms.MainMenu(); 
    this.button1 = new System.Windows.Forms.Button(); 
    this.SuspendLayout(); 
    // 
    // button1 
    // 
    this.button1.Location = new System.Drawing.Point(54, 153); 
    this.button1.Name = "button1"; 
    this.button1.Size = new System.Drawing.Size(133, 53); 
    this.button1.TabIndex = 0; 
    this.button1.Text = "button1"; 
    this.button1.Click += new System.EventHandler(this.button1_Click); 
    // 
    // Form1 
    // 
    this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); 
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 
    this.AutoScroll = true; 
    this.ClientSize = new System.Drawing.Size(240, 268); 
    this.Controls.Add(this.button1); 
    this.Menu = this.mainMenu1; // **<-- RIGHT HERE, the error is: "ObjectDisposed Exception was unhandled"** 
    this.Name = "Form1"; 
    this.Text = "Form1"; 
    this.ResumeLayout(false); 

} 

如果我取消注释该行并在仿真器中运行它,它仍然可以正常工作,如果我将其部署到设备中,则会得到运行时错误,并且日志不会有太大帮助。

我已经设置编译器将最新的.net ce发送到设备,它是Windows Mobile 6.1 Motorola MC5590。

任何想法我可能做错了什么?

回答