core部署
Posted zwei1121
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了core部署相关的知识,希望对你有一定的参考价值。
开发/发布/缺陷分离模型 (支持 master/develop/feature/release/hotfix 类型分支)
perfmon
eventvwr
1.yum install mysql
2.yum install libgdiplus-devel
3.COMPlus_ThreadPool_ForceMinWorkerThreads=250
.net core 2.0 session
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-2.1&tabs=aspnetcore2x
<remove name="aspNetCore"/>
SslMode=None
<PropertyGroup> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> </PropertyGroup>
https://blog.csdn.net/hailang2ll/article/details/79241444
https://blog.csdn.net/hailang2ll/article/details/79759241
https://www.cnblogs.com/durow/archive/2016/08/12/5765145.html
https://stackoverflow.com/questions/39530495/dotnetcore-1-0-1-windowshosting-installation-fails-for-iis-windows-server-2012r2
.net Core2.0应用程序发布window服务器报错容易错过的配置。
1.应用程序发布。
2.IIS上新建网站。
3.应用程序池选择无托管代码。
4.服务器上安装DotNetCore.1.0.1-WindowsHosting。DotNetCore.1.0.4_1.1.1-WindowsHosting.exe https://go.microsoft.com/fwlink/?linkid=844461
安装成功后重启服务器。
在命令程序中输入 net stop was /y 停止服务
net start w3svc重启服务。
5.安装 dotnet-sdk-2.0.0-win-gs-x64
在你的csproj文件里面,
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish> </PropertyGroup>
</Project>
加入MvcRazorCompileOnPublish=false这句。
具体请参考
https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?tabs=aspnetcore2x
- <handlers>
- <remove name="aspNetCore"/>
- <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" requireAccess="Script" />
- </handlers>
GetCurrentDirectory
Microsoft.AspNetCore.Http.DefaultHttpContext.get_Session()
不能随意添加“”结尾
GetRequestStream()方法了,而变为了GetRequestStreamAsync()。
dynamic type = (new Program()).GetType();
string currentDirectory = Path.GetDirectoryName(type.Assembly.Location);
Console.WriteLine(currentDirectory);
public class HomeController : Controller { private readonly IHostingEnvironment _hostingEnvironment; public HomeController(IHostingEnvironment hostingEnvironment) { _hostingEnvironment = hostingEnvironment; } public ActionResult Index() { string webRootPath = _hostingEnvironment.WebRootPath; string contentRootPath = _hostingEnvironment.ContentRootPath; return Content(webRootPath + " " + contentRootPath); } }
安装.NET Core的环境有两种方式,SDK和Runtime,区别类似java的JDK和JRE。
- services.Configure(options =>
- {
- // Password settings
- //是否要求有数字
- options.Password.RequireDigit = false;
- //密码要求的最小长度
- options.Password.RequiredLength = 6;
- //是否要求有非字母数字的字符
- options.Password.RequireNonAlphanumeric = false;
- //是否要求有大写的ASCII字母
- options.Password.RequireUppercase = false;
- //是否要求有小写的ASCII字母
- options.Password.RequireLowercase = false;
- options.Password.RequiredUniqueChars = 6;
- });
https://www.liziwu.net/topic/31.html
https://blog.csdn.net/zzzili/article/details/79288040
HttpContext.Connection.RemoteIpAddress.ToString();
https://blog.yahui.wang/2018/05/31/jenkins-docker-dotnet-core-publish/
https://blog.csdn.net/qq4165498/article/details/77484530
发布iis站点时,文件被占用
使用 app_offline.htm
配置文件解决
可以先用ftp插件上传一个app_offline.htm
文件,部署完站点之后删除此文件
具体参考:https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.1#app_offlinehtm
执行远程命令 解除占用
上一种解决方案文件被占用的方案有个弊端,app_offline.htm生效时间无法保证,所以最直接方案是直接使用命令行 关闭和启动站点 来解除占用
更新nuget包:dotnet restore
运行:cd aspnetcoreapp dotnet run
编译:dotnet publish -c release
dotnet restore
dotnet build
dotnet publish
发布
https://blog.csdn.net/qq4165498/article/details/77484530
<aspNetCore processPath="dotnet" arguments=".dll" stdoutLogEnabled="true" stdoutLogFile=".logsstdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
ASPNETCORE_ENVIRONMENT
謝謝,CentOS里是这样解决的:
#locate libdl /usr/lib64/libdl-2.17.so /usr/lib64/libdl.so.2 #cd /usr/lib64 #ln -s libdl-2.17.so libdl.so
然后又报另外一个错误:Unable to load DLL ‘libgdiplus‘
yum install libgdiplus-devel
以上是关于core部署的主要内容,如果未能解决你的问题,请参考以下文章
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法(转)(代码片段
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法(转)(代码片段
Macos 部署目标 firestore/firebase_core
我们是在 ubuntu 上使用的 System.Drawing.Common ,当时遇到的问题是 .NET Core使用System.Drawing.Common时找不到libgdiplus的问题