C#项目关于HRMsys.exe”不包含适合于入口点的静态“Main”方法

做项目练习时,不小心删除了文件

又添加了APP.xaml,运行出现了HRMsys.exe”不包含适合于入口点的静态“Main”方法问题

和以前做过的项目做对比,程序的如果地址在App.xaml中,而运行出错的显然没有程序口地址

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace Customerapp
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
    }
}

  

APP 转到定义,两段代码对比,一切尽在不言中。

namespace HRMsys.UI {

    /// <summary>
    /// App
    /// </summary>
    public partial class App : System.Windows.Application, System.Windows.Markup.IComponentConnector {

        private bool _contentLoaded;

        /// <summary>
        /// InitializeComponent
        /// </summary>
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public void InitializeComponent() {

            #line 4 "..\..\App.xaml"
            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);

            #line default
            #line hidden
            if (_contentLoaded) {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/HRMsys;component/app.xaml", System.UriKind.Relative);

            #line 1 "..\..\App.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
            this._contentLoaded = true;
        }
    }
}

  

namespace Customerapp {

    /// <summary>
    /// App
    /// </summary>
    public partial class App : System.Windows.Application {

        /// <summary>
        /// InitializeComponent
        /// </summary>
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public void InitializeComponent() {

            #line 4 "..\..\App.xaml"
            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);

            #line default
            #line hidden
        }

        /// <summary>
        /// Application Entry Point.
        /// </summary>
        [System.STAThreadAttribute()]
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public static void Main() {
            Customerapp.App app = new Customerapp.App();
            app.InitializeComponent();
            app.Run();
        }
    }
}
时间: 2024-08-03 15:09:45

C#项目关于HRMsys.exe”不包含适合于入口点的静态“Main”方法的相关文章

WPF 不包含适合于入口点的静态“Main”方法

手动创建App.xaml作为启动项目时,编译时提示错误: 1>------ 已启动生成: 项目: WpfApplication11, 配置: Debug Any CPU ------ 1>CSC : error CS5001: 程序"e:\RefCode\C#\.....\obj\Debug\WpfApplication11.exe"不包含适合于入口点的静态"Main"方法 ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0

构造三层时报错“程序 “D:\MyTest\....”不包含适合于入口点的静态&quot;Main&quot;方法”

错误 1 程序“D:\MyTest\EBookShop\Model\obj\x86\Debug\Model.exe”不包含适合于入口点的静态“Main”方法 原因:原来创建项目的时候,用的是“空项目”,我以为这样就会生成类库,实际上,一开始准备运行的时候,就会提示以上错误. 解决办法:1.右键类库属性 2.然后将输出类型由控制台应用程序改为类库 这样就好了,重新生成吧! 总结:下次注意,直接创建类库,如下图: 构造三层时报错"程序 "D:\MyTest\...."不包含适合于

不包含适合于入口点的静态&quot;Main&quot;方法

学习新建项目.此问题做为笔记. 错误 1 程序“admin.exe”不包含适合于入口点的静态“Main”方法 原因:原来创建项目的时候,用的是“空项目”,我以为这样就会生成类库,实际上,一开始准备运行的时候,就会提示以上错误. 解决办法:1.右键类库属性 2.然后将输出类型由控制台应用程序改为类库 这样就好了,重新生成吧! 不包含适合于入口点的静态"Main"方法

Net Core通用主机项目报错 程序不包含适合于入口点的静态Main

Net Core通用主机的介绍: https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-2.1 参考官网教程编写代码,编译报错:错误         CS5001     程序不包含适合于入口点的静态 "Main" 方法 错误代码public static async Task Main(string[] args) 问题原因:async Task Main

不包含适合于入口点的静态“Main”方法/does not contain a static &#39;Main&#39; method suitable for an entry point

error:as subject solution: 1. Must be declared as static 2. Main, is defined with the wrong case, such as lower-case main. 3. must return void or int 4. it must have either no parameters or else one parameter of type string[] static void Main() { //

不包含适合于入口点的静态“Main”方法

问题背景 建立一个C#项目之后,删除了自带的Class1类.完成了程序的编写之后提示如下错误: 问题解决 方案1 在 public partial class MainForm : Form下面添加这句话 public static void Main(string[] args) { // Starts the application. Application.Run(new FormXXX());//FormXXX是你定义的窗口类 } 程序就可以运行了. 方案2 在form窗体的代码类中添加

C#.NET常见问题(FAQ)-程序不包含适合于入口点的静态“Main”方法怎么办

如下图所示,一般程序上次运行还好好的,而且不管你复制粘贴再简单的程序也出现这种错误提示. ? 先点击右侧的显示所有文件,下面列举了所有CS文件,右击点击包括在项目中,则该文件呈现绿色,再运行即可.不过这种方法有一个问题,你再去运行别的文件的时候又要重新包含别的一次,还要把这次的包含去掉,总之一次只能包含一个CS文件,否则就报错. ? ? 更多教学视频和资料下载,欢迎关注以下信息: 我的优酷空间: http://i.youku.com/acetaohai123 ? 我的在线论坛: http://c

程序定义了多个入口点。使用 /main (指定包含入口点的类型)进行编译

原文:请使用/main进行编译,以指定包含入口点类型 在使用VS工具初学C#的时候需要不停的写小程序,觉得每次都新建项目太过麻烦,所以试着把程序写在一个项目下面,结果编译的时候出错了,因为我每个小程序都使用的Main()方法,而VS的提示信息虽然看得懂原因,却不明白要怎么做,后来查阅MSDN得到解决办法,在此与跟我有同样疑惑的人分享: 解决办法: VS界面点击:项目-->XX属性-->应用程序  在此页有一个启动对象属性设置成你想启动的那个类名就可以了. 另外:/main进行编译是指在CMD命

centos6.5下yum安装lnmp(适合刚入职的新手的方法)

新入职的员工,开始的时候都是让配环境,本地写代码用的wamp,在lnmp或lamp测试,除非有些土豪公司 用的是(果机). 另外安装时,把整个流程在脑子里先过一篇(记不全也没关系,一回生二回熟),重在实践,实践出真知! 一:首先要在自己电脑安装一个虚拟主机软件,我这有: vmware10 ---> 网盘地址:http://pan.baidu.com/s/1pJt5HVl centos6.5(32位):网盘地址:http://pan.baidu.com/s/1pJqNLxD xshell4:  网