.netcore发布时指定服务器的系统类型
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发布时指定服务器的系统类型的更多相关文章
- web站点和windows服务项目发布时如何排除指定文件
在发布asp.net站点和windows服务项目时,有的时候这样的需求:msbuild编译之后发布到服务器指定目录时要排除指定文件,比如通过jenkins构建时,不希望覆盖原来的Web.config和 ...
- php 通过PATH_SEPARATOR判断当前服务器系统类型
PATH_SEPARATOR是php中的一个预定义常量,我们可以直接echo这个常量,在linux系统中,该常量输出":",在windows系统中,该常量输出";&quo ...
- 函数用途:同一域名对应多个IP时,获取指定服务器的远程网页内容
<?php /************************ * 函数用途:同一域名对应多个IP时,获取指定服务器的远程网页内容 * 创建时间:2008-12-09 * 创建人:张宴(img. ...
- windows上用命令行我们查看机器cpu信息(使用计算器-程序员模式-四字时,查看系统类型)
查看系统是64位还是32位 C:\Users\qingshuic>wmic os get osarchitecture OSArchitecture 64-bitC:\Users\qingshu ...
- 关联容器--保存指针时要指定容器的比较类型---引用Effective STL
无论何时你建立指针的关联容器,注意你也得指定容器的比较类型.大多数时候,你的比较类型只是解引用指针并比较所指向的对象(就像上面的StringPtrLess做的那样).鉴于这种情况,你手头最好也能有一个 ...
- .Net Core应用程序发布时不同方式的差别
.Net Core的文档更新的真是快..每次看的时候都觉得之前是不是梦游看的...每次发布应用程序的时候都要翻看下文档..至少rid是死活记不住.还是留个RID的索引吧..还有发布的索引 ,这样就好复 ...
- kafka高吞吐量的分布式发布订阅的消息队列系统
一:kafka介绍kafka(官网地址:http://kafka.apache.org)是一种高吞吐量的分布式发布订阅的消息队列系统,具有高性能和高吞吐率. 1.1 术语介绍BrokerKafka集群 ...
- JEECMS v8 发布,java 开源 CMS 系统
JEECMSv8 是国内java开源CMS行业知名度最高.用户量最大的站群管理系统,支持栏目模型.内容模型交叉自定义.以及具备支付和财务结算的内容电商为一体: 对于不懂技术的用户来说,只要通过后台的 ...
- Shell获取Aix/linux/unix机器上db2和os的信息并上传到指定服务器
(之前写过一篇类似的文章,当时传输文件用的是ftp,因为项目觉得ftp不够安全所以这次换成了scp,同时对脚本的一些地方也做了一些调整) 其实做这个东西还是因为项目的需求,需要获取某些机器(目前主要是 ...
随机推荐
- 史上最全的中高级Java面试题汇总
原文链接:https://blog.csdn.net/shengqianfeng/article/details/102572691 memcache的分布式原理 memcached 虽然称为 “ 分 ...
- sql-server-dmv-starter-pack
SELECT wait_type , ) AS [wait_time_s] FROM sys.dm_os_wait_stats DOWS WHERE wait_type NOT IN ( 'SLEEP ...
- 在Angular中使用element
在angular中使用element 1.在一个新建的angular的项目中插入element npm i --save element-angular 2.在项目中的styles.css中插入文件, ...
- 关于docker的scratch镜像与helloworld
关于docker的scratch镜像与helloworld 参考:https://hub.docker.com/_/scratch?tab=description 参考:https://segment ...
- TimSort Java源码个人解读
/*JDK 1.8 */ package java.util; /** * A stable, adaptive, iterative mergesort that requires far fewe ...
- [Linux] 在 Ubuntu 19.10 上开启 SSH 服务并允许远程登录
在 Ubuntu 19.10 上安装 SSH,并开启服务 0.检查并确认系统当前是否已安装SSH: sudo ps -e | grep ssh 如果只有 ssh-agent 说明 ssh-server ...
- BJFU-215-基于链式存储结构的图书信息表的排序
这里用的是冒泡排序 #include<stdio.h> #include<stdlib.h> #define MAX 100 typedef struct Book{ doub ...
- Python全栈开发相关课程
Python全栈开发 Python入门 Python安装 Pycharm安装.激活.使用 Python基础 Python语法 Python数据类型 Python进阶 面向对象 网络编程 并发编程 数据 ...
- pytest_02-用例运行规则
用例设计原则 文件名以test_*.py文件和*_test.py 以test_开头的函数 以Test开头的类 以test_开头的方法 所有的包pakege必须要有__init__.py文件 help帮 ...
- WebService 与WebAPI的差异性
对于 WebService和 Web API这两个概念, WebService是一个广义的概念,既 包括采用 RPC的 SOAP WebService,也包括直接建立在 Web 上的非 SOAP We ...