在Visual Studio 2022中使用Custom .NET核心模板

发布于 2025-02-10 07:21:18 字数 1539 浏览 0 评论 0原文

我已经创建了一个准骨 git-repository with github Action 发布包含2个.NET模板的Nuget软件包。可以使用这些模板安装这些模板

dotnet new --install MintPlayer.AspNetCore.IdentityServer.Templates

,然后您可以使用Visual Studio 2022中的这些模板创建一个新项目

dotnet new id-provider

,即使我添加了.template.config/ide.host.json 文件:

{
  "$schema": "http://json.schemastore.org/vs-2017.3.host",
  "order": 0,
  "icon": "music_note_64.png",
  "symbolInfo": [
  ]
}

我还需要做什么才能将它们带入Visual Studio 2022?我是否需要一个vSix软件包,例如此示例?是否有必要将VSIX上传到Visual Studio Marketplace?

I've created a bare-bone git-repository with a Github Action which builds and publishes a nuget package containing 2 .NET templates. These templates can be installed using

dotnet new --install MintPlayer.AspNetCore.IdentityServer.Templates

Then you can create a new project using

dotnet new id-provider

But these templates aren't available from Visual Studio 2022, even though I've added the .template.config/ide.host.json file:

{
  "$schema": "http://json.schemastore.org/vs-2017.3.host",
  "order": 0,
  "icon": "music_note_64.png",
  "symbolInfo": [
  ]
}

What do I need to do to get them into Visual Studio 2022 too? Do I need a VSIX package, like in this example? Is it necessary to upload a VSIX to the Visual Studio Marketplace?

Use .NET Templates in Visual Studio

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤带着心事 2025-02-17 07:21:18

好的,显然我在template.json文件中缺少以下内容

"tags": {
  "language": "C#",
  "type": "project"
}

,看来您还必须服用以下帐户:

名称描述
组识别该模板所属的组ID。与标签的结合结合使用时,这允许将多个模板显示为一个模板,并在每个枢轴类别(键)中以将其作为选择的决定,

因此,如果您希望它们在Visual Studio中以2为2单独的模板,您需要不同的值group Indidentity

Ok so apparently I was missing the following in the template.json file

"tags": {
  "language": "C#",
  "type": "project"
}

And it seems that you also have to take the following into account:

NameDescription
groupIdentityThe ID of the group this template belongs to. When combined with the tagssection, this allows multiple templates to be displayed as one, with the the decision for which one to use being presented as a choice in each one of the pivot categories (keys)

So if you want them in Visual Studio as 2 separate templates, you need different values for groupIdentity

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文