【发布时间】:2018-06-13 14:09:12
【问题描述】:
我正在使用SharpDevelop,但我把App.xaml 移到了一个子目录中。
当我尝试启动/调试应用程序时,C# 表示我的应用程序没有入口点或静态主方法 (CS5001)。
Edit < Undo 或移动到默认主文件夹将不起作用。
怎么了?
App.xaml
<Application x:Class="SongManager.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Boot">
</Application>
App.xaml.cs
using System;
using System.Windows;
using SmuleTools;
namespace SongManager {
public partial class App : Application {
private Account user;
public App() {
}
public Account getAccount() {
return this.user;
}
[STAThread]
private void Boot(object sender, StartupEventArgs e) {
Login login = new Login();
login.AuthSuccess((Object result) => {
this.user = (Account) result;
Manager window = new Manager(this);
window.Show();
login.Close();
});
login.Show();
}
}
}
【问题讨论】:
-
从备份恢复(Git)?
-
手动修复,新建一个空项目,找出差异。
-
项目->属性下的“启动对象”ComboBox中是否列出了App类?在那里您应该能够选择包含应用程序 Main 方法的类型
-
当我使用 Git 时,我肯定会回滚。但目前我在这些项目上使用的不是 Git @bommelding
-
@mm8 不,在左侧的下拉列表中我可以选择
Windows Application、Console Application、Library或.NET Module,但在右侧的输入/下拉列表中,不听任何课程;在这里我尝试手动编写(有和没有命名空间)
标签: c# wpf xaml sharpdevelop entry-point