.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,同时对脚本的一些地方也做了一些调整) 其实做这个东西还是因为项目的需求,需要获取某些机器(目前主要是 ...
随机推荐
- keystone源码阅读--python函数
按照setup.sfg文件中[entry_poubts]中的声明前后阅读: 1.cmd.manage:main os.path.join(path,name):连接目录与文件名或目录os.path.e ...
- SQL - 外链接和内连接
外链接和内连接: leetcode 题目:编写一个 SQL 查询,满足条件:无论 person 是否有地址信息,都需要基于上述两表提供 person 的以下信息: 第一次的答案:(错误) select ...
- linux配置ssh免密钥登录
https://blog.csdn.net/xiaoyi23000/article/details/80597516 1.执行命令ssh-keygen -t rsa,生成公钥和私钥 2.会在当前用户的 ...
- LeetCode 942. 增减字符串匹配(DI String Match) 49
942. 增减字符串匹配 942. DI String Match 题目描述 每日一算法2019/6/21Day 49LeetCode942. DI String Match Java 实现 and ...
- Python之路【第三十一篇】:django ajax
Ajax 文件夹为Ajaxdemo 向服务器发送请求的途径: 1.浏览器地址栏,默认get请求: 2.form表单: get请求 post请求 3.a标签,超链接(get请求) 4.Ajax请求 特点 ...
- C# 获取特殊日期
//1.当前时间DateTime dt = DateTime.Now; //2.本周周一DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.D ...
- 突然用xcode老版本调试老代码测试新机,报错"Could not find Developer Disk Image"回忆下
转载:https://www.cnblogs.com/blogwithstudyofwyn/p/6003176.html 说明:更新了手机的到了iOS 10.0.2.真机调试时候提示"Cou ...
- 【转载】C#中Convert.ToInt32方法将字符串转换为Int32类型
在C#编程过程中,可以使用Convert.ToInt32方法将字符串或者其他可转换为数字的对象变量转换为ToInt32类型,Convert.ToInt32方法有多个重载方法,最常使用的一个方法将字符串 ...
- python day 17: UML(统一建模语言)
python day 17 UML:unified modeling languages,是一种基于面向对象的可视化建模语言. 画图语言:画图要合理.即符合逻辑. 历史: 3.1. 软件功能越来越强大 ...
- 在Spring中使用AspectJ实现AOP
在Spring中,最常用的AOP框架是AspectJ,使用AspectJ实现AOP有2种方式: 基于XML的声明式AspectJ 基于注解的声明式AspectJ 基于XML的声明式AspectJ 1. ...