当前位置:网站首页 / vs2022 / 正文

ay vs2022 来学习开发个vs2022主题

时间:2022年05月19日 | 作者 : aaronyang | 分类 : vs2022 | 浏览: 492次 | 评论 0

废话不多说, 声明线

====================www.ayjs.net       杨洋    wpfui.com        ayui      ay  aaronyang=======请不要转载谢谢了。=========

打开github,下载微软的开源库

microsoft/theme-converter-for-vs: CLI tool that allows you to convert your VS Code color theme to a VS 2022 color theme. (github.com)

电脑环境:

VS Code

VS 2022 Preview 3 或更高版本以获得最佳效果

可以通过 Visual Studio 安装程序安装以下单个组件:.NET 5.0 运行时、.NET 桌面开发工作负载和 Visual Studio 扩展开发工作负载。

image.png

在管理员模式下打开命令行

我用的win+X  powershell管理员


克隆仓库

转到 <your_clone_path>\ThemeConverter\ThemeConverter 并使用 dotnet build ThemeConverter.csproj 构建转换器项目。


我的路径

D:\aystudyvs2022\theme-converter-for-vs-main\ThemeConverter\ThemeConverter


powershell

D:\aystudyvs2022\theme-converter-for-vs-main\ThemeConverter\ThemeConverter

image.png

转到 <your_clone_path>\ThemeConverter\ThemeConverter\bin\Debug\net5.0。

image.png

使用获取主题的 json 文件部分中描述的步骤获取主题文件

============= 打开vscode =======

搜索个喜欢的主题,我搜了Winter is Coming

image.png

然后按下Ctrl+shift+p,输入 gener

image.png

如果英文的vscode

image.png

单击它

image.png

Ctrl+A全选,

Ctrl+K+U 格式化


我在源码地方 新建了AYTheme文件夹

image.png


然后把这个主题颜色文件,Ctrl+S保存到这里,后缀名从jsonc改为json

image.png


接下来,powershell 

cd D:\aystudyvs2022\theme-converter-for-vs-main\ThemeConverter\ThemeConverter\bin\Debug\net5.0


运行 ThemeConverter.exe -h 查看工具的使用情况,根据自己的需要使用工具。

 ./ThemeConverter.exe -h

image.png

如果要转换主题并将其修补到目标 VS:

运行 ThemeConverter.exe -i <path_to_theme_json> -t <target_vs_installation_path>

示例:ThemeConverter.exe -i "C:\myTheme\TestTheme.json" -t "C:\Program Files\Microsoft Visual Studio\2022\Preview"。此命令将转换 TestTheme,将生成的 json 修补到目标 VS 并使用转换后的主题启动 VS。

注意:VS的安装路径可以在你的VS安装器中找到(修改页面的位置字段)。

现在您可以在工具 -> 主题下看到转换后的主题!享受!

如果您只想转换主题并获取生成的 pkgdef:

运行 ThemeConverter.exe -i <path_to_theme_json> -o <output_path>

示例:ThemeConverter.exe -i "C:\myTheme\TestTheme.json" -o "C:\myTheme\results"。此命令将转换主题,生成的 pkgdef 将为 C:\myTheme\results\TestTheme.pkgdef。

我的操作:

./ThemeConverter.exe -i "D:\aystudyvs2022\theme-converter-for-vs-main\ThemeConverter\ThemeConverter\AYTheme\wintercomming.json" -t "C:\Program Files\Microsoft Visual Studio\2022\Preview"

等待会,会自动打开vs2022

image.png

-t是可选的,-i不是可选

image.png

]34P5HK@TI112N2(5%ZN%KU.png


为新主题打包成vsix

生成pkgdef ,建议不要把json文件夹和输出的文件设置为一个

./ThemeConverter.exe -i "D:\aystudyvs2022\theme-converter-for-vs-main\ThemeConverter\ThemeConverter\AYTheme\wintercomming.json" -o "D:\aystudyvs2022\theme-converter-for-vs-main\ThemeConverter\ThemeConverter\AyDarkBlueWinner.pkgdef"

image.png

我的名字AyDarkBlueTheme

在程序集右键,添加现有项

image.png

设置文件属性

image.png

====================www.ayjs.net       杨洋    wpfui.com        ayui      ay  aaronyang=======请不要转载谢谢了。=========

双击source.extension.vsixmanifest

image.png

设置 Type to Microsoft.VisualStudio.VsPackage,  Source 为 File on filesystem.

选择 Browse and select the .pkgdef you added. Select OK.

image.png

编辑其他信息

我把这里改了下试试,看看我的vs2019能不能装

image.png

然后编译

image.png

然后把这个AyDarkBlueTheme.vsix拷贝给别人就行了



移除主题

我的路径

C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Platform

下方有个

image.png

删除这个文件

关闭vs,打开对应vs的命令行工具,

image.png

输入devenv /updateConfiguration

image.png


====================www.ayjs.net       杨洋    wpfui.com        ayui      ay  aaronyang=======请不要转载谢谢了。=========


关闭vs,然后 我们安装刚刚的vsix

image.png

看来不能安装在vs2019上


====================www.ayjs.net       杨洋    wpfui.com        ayui      ay  aaronyang=======请不要转载谢谢了。=========









推荐您阅读更多有关于“vs2022,”的文章

猜你喜欢

额 本文暂时没人评论 来添加一个吧

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

  查看权限

抖音:wpfui 工作wpf,兴趣学习flutter

目前在合肥市某公司上班,已经厌弃,如果你的公司看的上我,加我QQ私聊

AYUI8全源码 Github地址:前往获取

杨洋(AaronYang简称AY,安徽六安人)AY唯一QQ:875556003和AY交流

高中学历,2010年开始web开发,2015年1月17日开始学习WPF

声明:AYUI7个人与商用免费,源码可购买。部分DEMO不免费

不是从我处购买的ayui7源码,我不提供任何技术服务,如果你举报从哪里买的,我可以帮你转正为我的客户,并送demo

查看捐赠

AYUI7.X MVC教程 更新如下:

第一课 第二课 程序加密教程

标签列表