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

PostAction Scripts don't run in Visual Studio #6777

Open
theLeftTenant opened this issue Jun 19, 2023 · 8 comments
Open

PostAction Scripts don't run in Visual Studio #6777

theLeftTenant opened this issue Jun 19, 2023 · 8 comments
Labels
area: Visual Studio The issue is related to Visual Studio New Project Dialog features related to template engine. feature The issue defines new feature. need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases triaged The issue was evaluated by the triage team, placed on correct area, next action defined.

Comments

@theLeftTenant
Copy link

theLeftTenant commented Jun 19, 2023

Product

Visual Studio

Describe The Bug

When running dotnet new [template] on a template with a post action script, the user is prompted to respond with a Yes/No on whether they will allow the template to run a post action script. However, in Visual Studio, this prompt never appears and the postAction script never runs.

To Reproduce

Steps:

  1. Create or install a template with a postAction script
  2. Test that it runs with the CLI
  3. Attempt to create a project with the same template in Visual Studio
  4. Observe that the script did not run

dotnet Info

output .NET SDK: Version: 7.0.304 Commit: 7e794e2806

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.304\

Host:
Version: 7.0.7
Architecture: x64
Commit: 5b20af47d9

.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
5.0.411 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]
6.0.102 [C:\Program Files\dotnet\sdk]
6.0.116 [C:\Program Files\dotnet\sdk]
6.0.202 [C:\Program Files\dotnet\sdk]
6.0.311 [C:\Program Files\dotnet\sdk]
7.0.304 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.7 [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

17.6.3

Additional context

No response

@theLeftTenant
Copy link
Author

If there is a known issue with no way to resolve, it'd be good to note that in the related wiki entry

@YuliiaKovalova
Copy link
Member

Hi @theLeftTenant ,

Thank you for reporting the issue.

@phenning, could you tell me if it belongs to your area?

@phenning
Copy link
Contributor

Currently, we don't run any post action scripts in Visual Studio or Visual Studio for Mac.

Please note that in the linked wiki entry, Visual Studio is not listed under the "Supported in:" section for that Post Action. This could probably be documented a bit more clearly in the wiki.

@theLeftTenant
Copy link
Author

@phenning thanks for the response. I assume packaging the template as a VSIX extension would make no difference?

The templates my team writes for developers throughout our company requires at least 3 postAction scripts to execute before the generated app will be fully deployable without manual intervention. Most of these developers use Visual Studio heavily, so it makes a lot of sense to let them directly generate the solutions within Visual Studio New Project GUI.

@YuliiaKovalova YuliiaKovalova added need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases feature The issue defines new feature. area: Visual Studio The issue is related to Visual Studio New Project Dialog features related to template engine. triaged The issue was evaluated by the triage team, placed on correct area, next action defined. labels Jun 20, 2023
@Didza
Copy link

Didza commented Oct 16, 2023

It would be really nice to have the postActions run within the visual studio GUI.

@JamieT-Shout
Copy link

+1

1 similar comment
@POFerro
Copy link

POFerro commented May 27, 2024

+1

@POFerro
Copy link

POFerro commented May 27, 2024

This is the one feature missing for me to completely switch to these new templates in my Visual Studio extension, looking forward to it.
Do you have any idea when will this be available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Visual Studio The issue is related to Visual Studio New Project Dialog features related to template engine. feature The issue defines new feature. need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

No branches or pull requests

6 participants