netcore 报错 502 缺少运行时

1,查看iis服务器报错原因,查看服务器管理器报错事情 错误原因

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.2.8' was not found.

缺少 对应的.NETCoresdk运行时,去下载对应sdk安装即可。

2,

An assembly specified in the application dependencies manifest (NY.TBWebApp.deps.json) was not found:
package: 'System.Diagnostics.PerformanceCounter', version: '4.5.0'

这个缺少生成的环境运行文件,可以是这个发布时生成运行文件即可

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

可以把这句放在Core的项目在FolderProfile.pubxml文件下添加<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> 

原文地址:https://www.cnblogs.com/njccqx/p/14651664.html