Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET new install <local-path> exiting with status code 0 on error #8200

Open
jankoosk opened this issue Jul 5, 2024 · 1 comment
Open

.NET new install <local-path> exiting with status code 0 on error #8200

jankoosk opened this issue Jul 5, 2024 · 1 comment

Comments

@jankoosk
Copy link

jankoosk commented Jul 5, 2024

Product

dotnet CLI (dotnet new)

Describe The Bug

I want to test if my templates are valid in CI/CD. I thought i could install the template in the workflow and it would fail if there are any errors. It turns out that even if there are errors with the template, the exit code is still 0.

To Reproduce

Steps:

  1. Create a new template
  2. malform template.config
  3. install template
  4. check exit code
$ dotnet new install content/WPF
[20]The following template packages will be installed:
[21]/templates/dotnet/content/WPF
[22]Error: The template 'WPF-Template' (Template.Dotnet.WPF) has the following validation errors:
[23][Error][MV012] Source ___location '../doesnotexist/' is outside the specified install source ___location.
[24]Error: Failed to load the template 'WPF-Template' (Template.Dotnet.WPF): the template is not valid.
[26]No templates were found in the package /templates/dotnet/content/WPF.
[27]$ echo $?
[28]0

dotnet Info

output .NET SDK: Version: 8.0.301 Commit: 1a0e9c0300 Workload version: 8.0.300-manifests.f6879a9a MSBuild version: 17.10.4+10fbfbf2e

Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.301\

Installierte .NET-Workloads:
Es sind keine installierten Workloads zum Anzeigen vorhanden.

Host:
Version: 8.0.6
Architecture: x64
Commit: 3b8b000a0e

.NET SDKs installed:
6.0.300 [C:\Program Files\dotnet\sdk]
6.0.321 [C:\Program Files\dotnet\sdk]
8.0.301 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Version

No response

Additional context

No response

@jankoosk
Copy link
Author

jankoosk commented Jul 5, 2024

If this is the intended behaviour, how can i check if my templates are valid before publishing them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant