VS2019
.NET Framework 4.8 SDKhttps://dotnet.microsoft.com/download/thank-you/net48-developer-pack.NET Core 3.0https://dotnet.microsoft.com/download/dotnet-core/3.0预览版需要在Options中的Environment/Preview Features中勾选Use previews of the .NET Core SDK扩展Extensions -> Manage Extensions* IntelliCode 微软的AI提示扩展* Viasfora 括号颜色扩展,建议VS黑色主题下使用* Visual Studio Spell Checker (VS2017 and Later) 拼写检查器* Add Multiple Projects To Solutions 可以将某个目录中的全部项目一次性添加到解决方案 右键解决方案,添加,Multiple Projects菜单项。* Add New File 可用来快速添加.gitignore文件,快速创建多级目录文件,一次多个文件 右键解文件夹,添加,会出现Add Empty Files菜单项。* VSColorOutput 能彩色显示Output窗口文本,调试输出时可自动加入时间戳 建议在Tool -> Options中找到此扩展配置,将Build Actions的属性全部设置为True。* Git Diff Margin 在代码编辑器左侧添加 Margin 列,用于快捷撤销代码的修改* Open Command Line 在解决方案管理器右键加入打开命令行快捷菜单* Favorite Documents 添加收藏菜单Extensions -> Favorites,可以收藏文件。 .gitignore 请排除文件:解决方案名.favdoc* VSBookmarks 仅支持在某个打开的文件里,Ctrl+Shift+1/Ctrl+1书签和跳转 Ctrl+1被跳转指令占用,需要手动Remove掉下面命令中使用了Ctrl+1的快捷键: Edit.GotoFile Edit.GotoMemeber Edit.GotoRecentFile Edit.GotoGymbol Edit.GotoType 或者在快捷键列表里搜索 VSBookmarks 对无法使用的快捷键重新分配* Line Endings Unifier 统一换行符的扩展(目前对vs2019支持不好) 建议用.editorconfig文件代替,然后用Run Code Cleanup来清理代码 清理全部解决方案:Analyze -> Code Cleanup中的命令。 建立.editorconfig的方法,右键解决方案 ->Add Item...,搜索 editorconfig, 可以选择(.NET)那个,下面是补充了 root = true 和 end_of_line = crlf=============.editorconfig-------------root = true# All files [*] indent_style = space # Code files [*.{cs,csx,vb,vbx}] indent_size = 4 insert_final_newline = true charset = utf-8-bom end_of_line = crlf=============关闭VS后会出现安装扩展窗口,点Modify安装好后再启动VS字体FiraCodehttps://github.com/tonsky/FiraCodechoco install -y firacode字体和括号高亮配置Tool -> Options,搜索font进入Environment/Font and color选项页* 将Text Editor的Font选择:Fira Code Retina,字号9* 在Display Items列表中找到Brace Matching(中文:大括号匹配):frontgrond会为选中的括号增加边框,VS黑色主题可以选择浅绿色background会为选中的括号增加背景,VS白色背景主题可以选择黄色二选一即可* 在选项页最上面的“显示其设置”里选择“[全部文本工具窗口]” 将Text Editor的Font选择:Fira Code Retina,字号9-----------------安装器下载https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=16#https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Professional&rel=16#https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Enterprise&rel=16#离线安装文件vs_community.exe --layout "D:\vs2019community" --lang zh-CN en-US --includeRecommended --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.Data Microsoft.VisualStudio.Workload.DataScience Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeCrossPlat Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NativeGame Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Workload.Python Microsoft.VisualStudio.Workload.Universal Microsoft.VisualStudio.Component.VC.140 Microsoft.VisualStudio.Component.VC.v141.x86.x64 Microsoft.Net.Component.4.6.1.SDK Microsoft.Net.Component.4.6.2.SDK Microsoft.Net.Component.4.6.2.TargetingPack Microsoft.Net.Component.4.7.1.SDK Microsoft.Net.Component.4.7.1.TargetingPack Microsoft.Net.Component.4.7.SDK Microsoft.Net.Component.4.7.TargetingPack Microsoft.Net.ComponentGroup.4.6.1.DeveloperTools Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools Microsoft.Net.ComponentGroup.4.7.DeveloperTools Microsoft.Component.ClickOnce Microsoft.Component.HelpViewer Microsoft.VisualStudio.Component.LinqToSql Microsoft.Net.Component.3.5.DeveloperTools注:VC.140/141是VS2015/2017 VC++ platform tools,补充.NET Framework 3.5, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2开发包,清理离线文件vs_community.exe --layout D:\vs2019community --clean D:\vs2019community\Archive\GUID\Catalog.json安装(自动)D:\vs2019community\vs_setup.exe --passive --norestart --noWeb --noUpdateInstaller --path cache="D:\VS2019\cache" --path shared="D:\VS2019\shared" --path install="D:\VS2019\Community"这里的--path install等价于后面的--installPath,默认的安装位置是:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"可以指定--productKey xxxxx-xxxxx-xxxxx-xxxxx-xxxxx安装序列号更新(自动)D:\vs2019community\vs_setup.exe update --passive --norestart --noWeb --installPath "D:\VS2019\Community"修改(手动)D:\vs2019community\vs_setup.exe modify --norestart --noWeb --installPath "D:\VS2019\Community"其他命令robocopy /MIR D:\vs2019community D:\vs2019professionalrobocopy /MIR D:\vs2019community D:\vs2019enterprise删除新目录下的所有文件(非文件夹),然后运行对应的离线命令。通过ScanInvalidFolders_VS2019(https://github.com/m2nlight/ScanInvalidFolders_VS2019/releases)工具扫描无效的文件,然后删除他们:C:\> for /f "tokens=*" %a in ('scaninvalidfolders.exe -d D:\vs2019community -q') do rd /s /q "D:\vs2019community\%a"其他安装器https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Professional&rel=16#https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Enterprise&rel=16#其他离线下载vs_professional.exe --layout "D:\vs2019professional" --lang zh-CN en-US --includeRecommended --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.Data Microsoft.VisualStudio.Workload.DataScience Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeCrossPlat Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NativeGame Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Workload.Python Microsoft.VisualStudio.Workload.Universal Microsoft.VisualStudio.Component.VC.140 Microsoft.VisualStudio.Component.VC.v141.x86.x64 Microsoft.Net.Component.4.6.1.SDK Microsoft.Net.Component.4.6.2.SDK Microsoft.Net.Component.4.6.2.TargetingPack Microsoft.Net.Component.4.7.1.SDK Microsoft.Net.Component.4.7.1.TargetingPack Microsoft.Net.Component.4.7.SDK Microsoft.Net.Component.4.7.TargetingPack Microsoft.Net.ComponentGroup.4.6.1.DeveloperTools Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools Microsoft.Net.ComponentGroup.4.7.DeveloperTools Microsoft.Net.Core.Component.SDK.2.2 Microsoft.NetCore.ComponentGroup.DevelopmentTools.2.2 Microsoft.NetCore.ComponentGroup.Web.2.2 Microsoft.Component.ClickOnce Microsoft.Component.HelpViewer Microsoft.VisualStudio.Component.LinqToSql Microsoft.Net.Component.3.5.DeveloperToolsvs_enterprise.exe --layout "D:\vs2019enterprise" --lang zh-CN en-US --includeRecommended --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.Data Microsoft.VisualStudio.Workload.DataScience Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeCrossPlat Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NativeGame Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Workload.Python Microsoft.VisualStudio.Workload.Universal Microsoft.VisualStudio.Component.VC.140 Microsoft.VisualStudio.Component.VC.v141.x86.x64 Microsoft.Net.Component.4.6.1.SDK Microsoft.Net.Component.4.6.2.SDK Microsoft.Net.Component.4.6.2.TargetingPack Microsoft.Net.Component.4.7.1.SDK Microsoft.Net.Component.4.7.1.TargetingPack Microsoft.Net.Component.4.7.SDK Microsoft.Net.Component.4.7.TargetingPack Microsoft.Net.ComponentGroup.4.6.1.DeveloperTools Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools Microsoft.Net.ComponentGroup.4.7.DeveloperTools Microsoft.Net.Core.Component.SDK.2.2 Microsoft.NetCore.ComponentGroup.DevelopmentTools.2.2 Microsoft.NetCore.ComponentGroup.Web.2.2 Microsoft.Component.ClickOnce Microsoft.Component.HelpViewer Microsoft.VisualStudio.Component.LinqToSql Microsoft.Net.Component.3.5.DeveloperTools链接释放日志https://docs.microsoft.com/visualstudio/releases/2019/release-notes企业版组件IDhttps://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-enterprise?view=vs-2019全部组件IDhttps://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids?view=vs-2019命令行https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2019-------在选项窗口中(Tools -> Options菜单命令),Environment -> International Settings可更改语言为简体中文。如果安装失败,可尝试多次执行下面命令清理安装和缓存:"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\Resources\app\layout\InstallCleanup.exe" -f注意,-f等于-full,会清除系统中的VS2017;可以指定-i清理instance,或者-c清理cache。然后删除程序目录rd /s /q "D:\VS2019"删除安装命令中的--passive参数,进入交互安装模式。-------Visual Studio 2019 将在以下操作系统上安装并运行(建议 64 位):Windows 10 版本 1703 或更高版本:家庭版、专业版、教育版和企业版(不支持 LTSC 和 Windows 10 S)Windows Server 2019:Standard 和 DatacenterWindows Server 2016:Standard 和 DatacenterWindows 8.1(带有更新 2919355):核心板、专业版和企业版Windows Server 2012 R2(更新 2919355):Essentials、Standard、DatacenterWindows 7 SP1(带有最新的 Windows 更新):家庭高级版、专业版、企业版、旗舰版
VS2017
安装器下载https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15#https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Professional&rel=15#https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Enterprise&rel=15#离线安装文件vs_community.exe --layout "D:\vs2017community" --lang zh-CN en-US --includeRecommended --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.Data Microsoft.VisualStudio.Workload.DataScience Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeCrossPlat Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NativeGame Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Workload.Python Microsoft.VisualStudio.Workload.Universal Microsoft.Component.Blend.SDK.WPF Microsoft.Component.HelpViewer Microsoft.Net.Component.3.5.DeveloperTools Microsoft.VisualStudio.Component.LinqToSql Microsoft.VisualStudio.Component.VC.140 Microsoft.Net.Component.4.6.2.SDK Microsoft.Net.Component.4.6.2.TargetingPack Microsoft.Net.Component.4.7.1.SDK Microsoft.Net.Component.4.7.1.TargetingPack Microsoft.Net.Component.4.7.2.SDK Microsoft.Net.Component.4.7.2.TargetingPack Microsoft.Net.Component.4.7.SDK Microsoft.Net.Component.4.7.TargetingPack Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.DeveloperTools注:VC.140是VS2015 VC++ platform tools. 补充.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2开发包清理离线文件vs_community.exe --layout D:\vs2017community --clean D:\vs2017community\Archive\GUID\Catalog.json安装(自动)D:\vs2017community\vs_setup.exe --passive --norestart --noWeb --noUpdateInstaller --path cache="D:\VS2017\cache" --path shared="D:\VS2017\shared" --path install="D:\VS2017\Community"这里的--path install等价于后面的--installPath,默认的安装位置是:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"更新(自动)D:\vs2017community\vs_setup.exe update --passive --norestart --noWeb --installPath "D:\VS2017\Community"修改(手动)D:\vs2017community\vs_setup.exe modify --norestart --noWeb --installPath "D:\VS2017\Community"其他命令robocopy D:\vs2017community D:\vs2017professional /MIRrobocopy D:\vs2017community D:\vs2017enterprise /MIR删除新目录下的所有文件(非文件夹),然后运行对应的离线命令。通过ScanInvalidFolders_VS2017(https://github.com/m2nlight/ScanInvalidFolders_VS2017/releases)工具扫描无效的文件,然后删除他们:C:\> for /f "tokens=*" %a in ('scaninvalidfolders.exe -d D:\vs2017community -q') do rd /s /q "D:\vs2017community\%a"其他安装器https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Professional&rel=15#https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Enterprise&rel=15#其他离线下载vs_professional.exe --layout "D:\vs2017professional" --lang zh-CN en-US --includeRecommended --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.Data Microsoft.VisualStudio.Workload.DataScience Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeCrossPlat Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NativeGame Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Workload.Python Microsoft.VisualStudio.Workload.Universal Microsoft.Component.Blend.SDK.WPF Microsoft.Component.HelpViewer Microsoft.Net.Component.3.5.DeveloperTools Microsoft.VisualStudio.Component.LinqToSql Microsoft.VisualStudio.Component.VC.140 Microsoft.Net.Component.4.6.2.SDK Microsoft.Net.Component.4.6.2.TargetingPack Microsoft.Net.Component.4.7.1.SDK Microsoft.Net.Component.4.7.1.TargetingPack Microsoft.Net.Component.4.7.2.SDK Microsoft.Net.Component.4.7.2.TargetingPack Microsoft.Net.Component.4.7.SDK Microsoft.Net.Component.4.7.TargetingPack Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.DeveloperToolsvs_enterprise.exe --layout "D:\vs2017enterprise" --lang zh-CN en-US --includeRecommended --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.Data Microsoft.VisualStudio.Workload.DataScience Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeCrossPlat Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NativeGame Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Workload.Python Microsoft.VisualStudio.Workload.Universal Microsoft.Component.Blend.SDK.WPF Microsoft.Component.HelpViewer Microsoft.Net.Component.3.5.DeveloperTools Microsoft.VisualStudio.Component.LinqToSql Microsoft.VisualStudio.Component.VC.140 Microsoft.Net.Component.4.6.2.SDK Microsoft.Net.Component.4.6.2.TargetingPack Microsoft.Net.Component.4.7.1.SDK Microsoft.Net.Component.4.7.1.TargetingPack Microsoft.Net.Component.4.7.2.SDK Microsoft.Net.Component.4.7.2.TargetingPack Microsoft.Net.Component.4.7.SDK Microsoft.Net.Component.4.7.TargetingPack Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools Microsoft.Net.ComponentGroup.4.7.DeveloperTools链接释放日志https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes企业版组件IDhttps://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-enterprise?view=vs-2017全部组件IDhttps://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids?view=vs-2017命令行https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2017--------在选项窗口中(Tools -> Options菜单命令),Environment -> International Settings可更改语言为简体中文。如果安装失败,可尝试多次执行下面命令清理安装和缓存:"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\Resources\app\layout\InstallCleanup.exe" -f注意,-f等于-full,会清除系统中的VS2017;可以指定-i清理instance,或者-c清理cache。然后删除程序目录rd /s /q "D:\VS2017"删除安装命令中的--passive参数,进入交互安装模式。