IIS上的ASP.NET Core 2.0错误502.5

IIS上的ASP.NET Core 2.0错误502.5,第1张

概述我将.net core 2.0安装到我的 Windows Server 2008 我有两个网络项目.它们都在我的电脑上工作.但是当我发布到我的服务器时,一个项目工作得非常好,但其他项目给出了错误 HTTP Error 502.5 – Process Failure Application ‘MACHINE/WEBROOT/APPHOST/KI-TAP.COM’ with physical root 我将.net core 2.0安装到我的 Windows Server 2008
我有两个网络项目.它们都在我的电脑上工作.但是当我发布到我的服务器时,一个项目工作得非常好,但其他项目给出了错误

http Error 502.5 – Process Failure

Application ‘MACHINE/WEbroOT/APPHOST/KI-TAP.COM’
with physical root ‘C:\HostingSpaces\Reseller1\ki-tap.com\wwwroot\’
Failed to start process with commandline
‘dotnet .\ki-tap.dll’,ErrorCode = ‘0x80004005 : 8000808c.

我更新我的windows服务器,但它仍然给出相同的错误.

这是我的program.cs(我这里没有添加代码.这是默认的)

public class Program    {        public static voID Main(string[] args)        {            BuilDWebHost(args).Run();        }        public static IWebHost BuilDWebHost(string[] args) =>            WebHost.CreateDefaultBuilder(args)                .UseStartup<Startup>()                .Build();    }

这是我的web.config(已发布和默认代码)

<?xml version="1.0" enCoding="utf-8"?><configuration>  <system.webServer>    <handlers>      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="UnspecifIEd" />    </handlers>    <aspNetCore processpath="dotnet" arguments=".\ki-tap.dll" stdoutLogEnabled="true" stdoutLogfile=".\logs\stdout" />  </system.webServer></configuration>

这是我的startup.cs(我添加了会话配置)

using System;using System.Collections.Generic;using System.linq;using System.Threading.Tasks;using Microsoft.AspNetCore.Builder;using Microsoft.AspNetCore.Hosting;using Microsoft.Extensions.Configuration;using Microsoft.Extensions.DependencyInjection;namespace ki_tap{    public class Startup    {        public Startup(IConfiguration configuration)        {            Configuration = configuration;        }        public IConfiguration Configuration { get; }        // This method gets called by the runtime. Use this method to add services to the container.        public voID ConfigureServices(IServiceCollection services)        {            services.AddMvc();            services.AddSession();        }        // This method gets called by the runtime. Use this method to configure the http request pipeline.        public voID Configure(IApplicationBuilder app,IHostingEnvironment env)        {            if (env.IsDevelopment())            {                app.UseDeveloperExceptionPage();                app.Usebrowserlink();            }            else            {                app.UseExceptionHandler("/Home/Error");            }            app.UseStaticfiles();            app.UseSession();            app.UseMvc(routes =>            {                routes.MapRoute(                    name: "default",template: "{controller=Home}/{action=Index}/{ID?}");            });        }    }}

编辑:
使用@set建议,我在cmd控制台的windows Server 2008中运行该命令

C:\Program files (x86)\dotnet\dotnet myProjectPath\project.DLL

它给出了以下错误.我该怎么办?

package: 'Microsoft.AspNetCore.Antiforgery',version: '2.0.1' path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'his assembly was expected to be in the local runtime store as the applications published using the following target manifest files: aspnetcore-store-2.0.3.xml
解决方法 您可能遇到与aspnet / IISIntegration repo中描述的 here相同的问题.解决方案是将以下内容添加到.csproj文件中:

<PropertyGroup>   <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest></PropertyGroup>

一般来说,这个问题的根源是本地计算机上的dotnet版本和服务器上的dotnet版本不同.

总结

以上是内存溢出为你收集整理的IIS上的ASP.NET Core 2.0错误502.5全部内容,希望文章能够帮你解决IIS上的ASP.NET Core 2.0错误502.5所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1236758.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存