.NET Framework编译/发布环境构建
.NET Framework 4.7.2
https://dotnet.microsoft.com/zh-cn/download/dotnet-framework
- SDK脱机安装包
https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/thank-you/net472-developer-pack-offline-installer - SDK中文语言包(不推荐安装,中文log容易出现乱码情况)
https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/thank-you/net472-developer-pack-chs
添加环境变量C:\"Program Files"\dotnet\
MSbuild Tools 2022
https://aka.ms/vs/17/release/vs_BuildTools.exe
https://www.catalog.update.microsoft.com/Search.aspx?q=visual%20studio%202022
- 安装只选MSbuild Tools,只有100多M,其它的不需要装
- MSbuild Tools 2022 同时支持.NET Framework和.NET Core
添加环境变量 C:\"Program Files (x86)"\"Microsoft Visual Studio"\2022\BuildTools\MSBuild\Current\
Nuget
https://learn.microsoft.com/zh-cn/nuget/install-nuget-client-tools#nugetexe-cli
就一个文件,扔到C:\Windows\System32\吧,省得加环境变量了
OpenSSH服务win2016需要,2019开始系统已自带
https://github.com/PowerShell/Win32-OpenSSH/releases
OpenSSH配置参考
http://www.taodudu.cc/news/show-5728150.html
https://docs.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_server_configuration
- 下载zip包,并放到C:\Program Files\下
- 添加系统环境变量C:\"Program Files"\OpenSSH-Win64
- 修改sshd配置文件C:\Program Files\OpenSSH-Win64\sshd_config_default
确保无注释(针对使用帐号密码登录)
PasswordAuthentication yes
cd C:\"Program Files"\OpenSSH-Win64
# 安装sshd
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
# 打开防火墙22端口
netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
# 启动sshd服务
net start sshd
# 添加一个专用于ssh登录的用户(也可以直接用系统用户)
net user username password /add
# 登录服务器
ssh -p [port] [username]@[ip] -v
打开系统服务,启动OpenSSH SSH Server
和 OpenSSH Authentication Agent
, 并把启动类型都改为自动
- 使用LInux免密连接Windows
https://blog.csdn.net/zhaodengdeng1984/article/details/121654821
CI\CD命令
# 还原引用包
nuget restore
# 编译
msbuild xxxx.sln /t:restore; /t:build /p:Configuration=Release
# 将编译结果打包为zip文件(方便传输到生产服务器)
Compress-Archive Build\Release\* -DestinationPath .\release.zip -CompressionLevel Fastest
# 解压
Expand-Archive .\release.zip -DestinationPath C:\test –Force -Verbose
.NET Framework迁移助手
dotnet tool install -g upgrade-assistant