从自定义Visual Studio模板中缺少领先点文件

发布于 2025-02-12 13:47:15 字数 2090 浏览 0 评论 0原文

我已经创建了一个自定义 Visual Studio template 包含ASP.Net Core+Angular Core+Angular Application 。但是,当我使用此模板创建一个新项目时,生成的项目中缺少以开头的文件。

这些是模板项目的 clientApp 文件夹中的文件:

”模板项目文件夹包含带有领先的文件dot“

但是,当我打包模板项目时,使用

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

这些文件安装它们是生成项目中缺少的:

”生成的项目不包含以“

我已经查看了以下内容,但没有成功:

当我运行时,

dotnet pack --configuration Release

我可以在控制台中看到以下印刷:

C:\...\NuGet.Build.Tasks.Pack.targets(221,5):
warning NU5119: File 'C:\repos\Example.AspNetCore.Templates\Example.AspNetCore.Templates\Templates\Application\Web\ClientApp\node_modules\resolve\.editorconfig' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline [C:\...\Example.AspNetCore.Templates.csproj]

如何无论如何我可以将这些文件作为“内容”包含在我的软件包中吗?

参考:

I've created a custom Visual Studio template containing an ASP.NET Core+angular application. But when I create a new project using this template, the files starting with . are missing from the generated project.

These are the files in the ClientApp folder of the template project:

The template project folder contains files with a leading dot

But when I package the template project, install them using

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

These files are missing from the generated project:

The generated project doesn't contain the files starting with a dot

I've already taken a look at the following, but without success:

When I run

dotnet pack --configuration Release

I can see the following printed in the console:

C:\...\NuGet.Build.Tasks.Pack.targets(221,5):
warning NU5119: File 'C:\repos\Example.AspNetCore.Templates\Example.AspNetCore.Templates\Templates\Application\Web\ClientApp\node_modules\resolve\.editorconfig' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline [C:\...\Example.AspNetCore.Templates.csproj]

How can I include these files anyway in my package as "Content"?

References:

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

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

发布评论

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

评论(1

暮年慕年 2025-02-19 13:47:15

添加

<NoDefaultExcludes>true</NoDefaultExcludes>

到root csproj文件解决了问题

spa-templates存储库做相同的

Adding

<NoDefaultExcludes>true</NoDefaultExcludes>

To the root csproj file solved the issue

The spa-templates repository does the same

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