asp.net core 开发完成后发布,在IIS上面访问,直接报错  系统是windows2008

Application startup exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-registry-l1-1-0.dll': 找不到指定的模块。 (Exception from HRESULT: 0x8007007E)
at Interop.mincore.RegOpenKeyEx(SafeRegistryHandle hKey, String lpSubKey, Int32 ulOptions, Int32 samDesired, SafeRegistryHandle& hkResult)
at Microsoft.Win32.RegistryKey.InternalOpenSubKeyCore(String name, RegistryRights rights, Boolean throwOnPermissionFailure)
at Microsoft.AspNetCore.DataProtection.RegistryPolicyResolver.ResolveDefaultPolicy()
at Microsoft.Extensions.DependencyInjection.DataProtectionServices.<GetDefaultServices>d__0.MoveNext()
at Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAdd(IServiceCollection collection, IEnumerable` descriptors)
at Microsoft.Extensions.DependencyInjection.DataProtectionServiceCollectionExtensions.AddDataProtection(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViewServices(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViews(IMvcCoreBuilder builder)
at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services)
at AppServiceByYc.Service.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Hosting environment: Production

自己已经解决了
就是发布的时候  必须要指定 你服务器的系统类型发布 要不然 以当前的系统发布 可能会不兼容
给个群友给的 发布程序

@echo off
echo 开始编译
pause
dotnet restore echo 选择编译到哪个操作系统
echo 0------all
echo 1------win7-x64
echo 2------win10-x64
echo 3------centos.7-x64
echo 4------osx.10.10-x64
echo 5------osx.10.11-x64
echo 6------osx.10.12-x64
echo 7------win7-x86 set /p input=操作系统: if %input%==1 (
dotnet publish -r win7-x64 -c release
)
if %input%==2 (
dotnet publish -r win10-x64 -c release
)
if %input%==3 (
dotnet publish -r centos.7-x64 -c release
)
if %input%==4 (
dotnet publish -r osx.10.10-x64 -c release
)
if %input%==5 (
dotnet publish -r osx.10.11-x64 -c release
)
if %input%==6 (
dotnet publish -r osx.10.12-x64 -c release
)
if %input%==7 (
dotnet publish -r win7-x86 -c release
) if %input%==0 (
dotnet publish -r win7-x64 -c release
dotnet publish -r win10-x64 -c release
dotnet publish -r centos.7-x64 -c release
dotnet publish -r osx.10.10-x64 -c release
dotnet publish -r osx.10.11-x64 -c release
dotnet publish -r osx.10.12-x64 -c release
dotnet publish -r win7-x86 -c release
) echo 按任意键退出
pause

出处:https://bbs.csdn.net/topics/392133922

.netcore发布时指定服务器的系统类型的更多相关文章

  1. web站点和windows服务项目发布时如何排除指定文件

    在发布asp.net站点和windows服务项目时,有的时候这样的需求:msbuild编译之后发布到服务器指定目录时要排除指定文件,比如通过jenkins构建时,不希望覆盖原来的Web.config和 ...

  2. php 通过PATH_SEPARATOR判断当前服务器系统类型

    PATH_SEPARATOR是php中的一个预定义常量,我们可以直接echo这个常量,在linux系统中,该常量输出":",在windows系统中,该常量输出";&quo ...

  3. 函数用途:同一域名对应多个IP时,获取指定服务器的远程网页内容

    <?php /************************ * 函数用途:同一域名对应多个IP时,获取指定服务器的远程网页内容 * 创建时间:2008-12-09 * 创建人:张宴(img. ...

  4. windows上用命令行我们查看机器cpu信息(使用计算器-程序员模式-四字时,查看系统类型)

    查看系统是64位还是32位 C:\Users\qingshuic>wmic os get osarchitecture OSArchitecture 64-bitC:\Users\qingshu ...

  5. 关联容器--保存指针时要指定容器的比较类型---引用Effective STL

    无论何时你建立指针的关联容器,注意你也得指定容器的比较类型.大多数时候,你的比较类型只是解引用指针并比较所指向的对象(就像上面的StringPtrLess做的那样).鉴于这种情况,你手头最好也能有一个 ...

  6. .Net Core应用程序发布时不同方式的差别

    .Net Core的文档更新的真是快..每次看的时候都觉得之前是不是梦游看的...每次发布应用程序的时候都要翻看下文档..至少rid是死活记不住.还是留个RID的索引吧..还有发布的索引 ,这样就好复 ...

  7. kafka高吞吐量的分布式发布订阅的消息队列系统

    一:kafka介绍kafka(官网地址:http://kafka.apache.org)是一种高吞吐量的分布式发布订阅的消息队列系统,具有高性能和高吞吐率. 1.1 术语介绍BrokerKafka集群 ...

  8. JEECMS v8 发布,java 开源 CMS 系统

    JEECMSv8 是国内java开源CMS行业知名度最高.用户量最大的站群管理系统,支持栏目模型.内容模型交叉自定义.以及具备支付和财务结算的内容电商为一体:  对于不懂技术的用户来说,只要通过后台的 ...

  9. Shell获取Aix/linux/unix机器上db2和os的信息并上传到指定服务器

    (之前写过一篇类似的文章,当时传输文件用的是ftp,因为项目觉得ftp不够安全所以这次换成了scp,同时对脚本的一些地方也做了一些调整) 其实做这个东西还是因为项目的需求,需要获取某些机器(目前主要是 ...

随机推荐

  1. [PHP] Laravel 体现 MySQL、Sqlite 数据的大小写敏感

    要想实现数据比对的大小写敏感,方式是设置数据库字段类型 或者 字段校验字符集. MySQL 和 Sqlite 所支持的 collations 形式是不同的,你可以通过以下文档了解到. MySQL co ...

  2. 局域网-断网&劫持(kali)

    1.查看局域网中的主机 fping –asg 192.168.1.0/24 2.断网 arpspoof -i wlan0 -t 192.168.100 192.168.1.1 (arpspoof  - ...

  3. Ubuntu下安装与卸载opencv模块

    opencv安装 因工程需要,想在python中调用opencv import cv2 现在记录一下如何在Linux系统(ubutun)下安装该模块: 参考了一篇博客:http://blog.csdn ...

  4. td宽度自适应 窄的地方自动收缩

    .layui-table td,.layui-table th { white-space: nowrap; width: auto; min-width: 0px!important; } 不换行! ...

  5. Flask源码之:路由加载

    路由加载整体思路: 1. 将 url = /index  和  methods = [GET,POST]  和 endpoint = "index"封装到Rule对象 2. 将Ru ...

  6. Redis缓存雪崩、击穿、穿透

    参考大佬 前言 Redis在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在Redis的使用和原理方面对小伙伴们进行360°的刁难.作为一个在互联网公司面一次拿一次offer的面霸(请允 ...

  7. ajax标准写法

    ajax 标准写法 $.ajax({ url:"http://www.microsoft.com", //请求的url地址 dataType:"json", / ...

  8. docker部署Asp.Net Core、Nginx、MySQL

    2019/10/24,docker19.03.4, .netcore 3.0,CentOS7.6 摘要:asp.net core 3.0 网站项目容器化部署,使用docker-compose编排Ngi ...

  9. SQLServer更新数据库每行一个随机数

    代码: ) DECLARE user_extension_cursor CURSOR FOR SELECT UserCode FROM Users OPEN user_extension_cursor ...

  10. celery 定时任务,使用crontab表达式不执行(版本4.3.x)

    celery 定时任务,使用crontab表达式不执行(版本4.3.x) 在使用celery 执行定时任务时,发现任务不会执行,schedule设置如下: 经测试,如果去掉hour,则任务每分钟都会执 ...