dfsdbh123 2020-05-08 15:13 采纳率: 0%
浏览 962

linux .net core 3.1 dotnet 没反应

centos 7

.net core sdk 已安装

图片说明

运行 dotnet xxx.dll 一直没反应
图片说明

一直卡在这里

代码如下

public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseUrls("http://*:9001");
                    webBuilder.UseStartup<Startup>();
                });
public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();
            services.AddControllersWithViews();

            //加载appsettings
            services.AddSingleton(new AppSettings(Env.ContentRootPath));
            //var MySecretKey = Appsettings.app(new string[] { "WebConfig", "MySecretKey" });

            services.AddDistributedMemoryCache();
            services.AddSession();

            services.AddDbContext<EFCoreDBContext>(options =>
            {
                options.UseSqlServer(Configuration.GetConnectionString("ConnConnection"));
            });

            services.AddScoped<IEFCoreDBContext, EFCoreDBContext>();
            services.AddScoped<IRepositoryFactory, RepositoryFactory>();
            services.AddScoped<IBaseService, BaseService>();

            services.AddScoped<ISysUserService, SysUserService>();
            services.AddScoped<ISysMenuService, SysMenuService>();


            services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(opt => { opt.LoginPath = new PathString("/Login/Index/"); });
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseStaticFiles();

            app.UseRouting();

            app.UseSession();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                //endpoints.MapRazorPages();使用pages文件夹

                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Login}/{action=Index}/{id?}");
            });
        }
  • 写回答

1条回答 默认 最新

  • dabocaiqq 2020-09-25 17:54
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置