如何解决 "开发环境错误"?

问题描述 投票:0回答:1

所有的页面都能正确的路由,但是在开发环境中我遇到了这个错误。enter image description here

启动时的配置方法如下。

        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Home/Main");
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseStaticFiles();
        app.UseCookiePolicy();

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Main}/{id?}");
        });
    }
asp.net-core
1个回答
0
投票

问题解决该错误是由于在用户端使用和调用了一个类(html视图)。当我删除该类后,网站很容易运行,没有出现错误。

© www.soinside.com 2019 - 2024. All rights reserved.