server2008安装.netcore api

一、先写个简单点的.net core api

 1     public class Program
 2     {
 3         public static void Main(string[] args)
 4         {
 5             var builder = WebApplication.CreateBuilder(args);
 6 
 7             // Add services to the container.
 8 
 9             builder.Services.AddControllers();
10 
11             var app = builder.Build();
12 
13             // Configure the HTTP request pipeline.
14 
15             app.UseAuthorization();
16 
17             app.UseDefaultFiles();
18             app.UseStaticFiles();
19             app.MapControllers();
20 
21             app.Run();
22         }
23     }

二、手动新建wwwroot文件夹,添加index.html文件

三、部署到客户IIS

客户服务器:windows server2008r2 ,安装.net core sdk ,runtime,hosting后,报500.19

命令行输入dotnet --info,发现没有安装成功

IIS上面模块也没有AspNetCoreModuleV2,查询后发现需要打补丁

搜索2008 Windows6.1-KB2533623-x64.msu,查到http://www.kkx.net/soft/21637.html

1、下载之后我们会得到两个补丁
Windows6.1-KB2533623-x64.msu
Windows6.1-KB2533623-x86.msu
2、根据自己的系统位数双击对应的补丁进行安装即可!我们用的64位的系统为示例

如果安装不了可以使用下面的方法:

1、把Windows6.1-KB2533623-x64.msu 放到 C:\Update

电脑开始,运行,输入CMD打开DOS窗口

再建入以下指令

expand –F:* C:\update\Windows6.1-KB2533623-x64.msu C:\update\

然后按回车键执行,然后再建入以下指令

dism.exe /online /Add-Package /PackagePath:C:\update\Windows6.1-KB2533623-x64.cab

然后按回车键执行

Windows就会跳过检测, 直接进入安装程序, 完成后会要求重启计算机

 

四,再次安装.netcore安装程序

这个时候,命令输入dotnet --info,已经正常了,可以查询到,但是打开网页还是报错,再把.net core 相关安装包安装一遍,再访问,就成功了

 

posted @ 2024-04-12 10:23  浪潮  阅读(1)  评论(0编辑  收藏  举报