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. Docker 两键创建 ZeroTier moon 节点

    一条命令创建 ZeroTier moon 节点: $ docker run --name zerotier-moon -d -p 9993:9993 -p 9993:9993/udp seedgou/ ...

  2. PIL和Pillow

    关于Pillow与PIL PIL(Python Imaging Library)是Python一个强大方便的图像处理库,名气也比较大.不过只支持到Python 2.7. PIL官方网站:http:// ...

  3. 【笔试题】Java final keyword

    Java 知识测试 Java final keyword Question 1 What is the use of final keyword in Java? A. When a class is ...

  4. SpringBoot整合websocket

    1.新增pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId& ...

  5. 更改ubuntu桌面环境

    1.修改桌面环境 update-alternatives --config x-session-manager 2.卸载某一种ppa源下面的软件 sudo apt-get install ppa-pu ...

  6. Django框架(十三)——Auth模块

    Auth模块 一.什么是auth模块 Auth模块是Django自带的用户认证模块 Auth模块是Django自带的用户认证模块,可以实现包括用户注册.用户登录.用户认证.注销.修改密码等功能.默认使 ...

  7. Html 对象的常用事件列举

    事件名称 触发时间 对象例举 OnBlur 对象失去输入焦点 窗口和所有的表单对象 OnChange 用户改变对象的值 文本框.文本区域.选择列表等 OnClick 用户鼠标点击 链接.按钮.单选钮. ...

  8. 转!!DBCP2 配置详解说明

    转自:https://www.cnblogs.com/diyunpeng/p/6980098.html 由于commons-dbcp所用的连接池出现版本升级,因此commons-dbcp2中的数据库池 ...

  9. spring使用JUnit测试,@Autowired无法注入原因

    在测试类上加入配置文件 代码如下 @RunWith(SpringJUnit4ClassRunner.class)// SpringJUnit支持,由此引入Spring-Test框架支持!  @Cont ...

  10. IPv4如何转换为IPv6?

    ipv6已经逐渐在应用,现在已经有很多的运营商支持ipv6,前天我们也发布了如何让电脑使用ipv6地址?有很多朋友在问?ipv6有什么作用,它的表示方式是什么,今天我们来一起来详细了解下ipv6相关计 ...