Closed pranavkm closed 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
We changed how SDK templates are installed recently. Instead of copying them into each dotnet new
version folder we leave them in place where SDK Installer puts them... And we don't allow users to uninstalling this templates anymore...
Plan we have for aspnetcore tests going forward is to provide --debug:disable-sdk-templates
which will allow aspnet tests to start with 0 templates installed and then install local templates as needed, is this solution acceptable?
Plan we have for aspnetcore tests going forward is to provide --debug:disable-sdk-templates which will allow aspnet tests to start with 0 templates installed and then install local templates as needed, is this solution acceptable?
That should work - our tests spend a bunch of time uninstalling the templates (and then verifying the uninstall command worked), this seems like a better option.
Out of curiosity, if we're able to add debug specific options to these commands, is it possible to have a dotnet new mytemplatename --debug:nupkg-path:<path-to-nupkg>
as an option which limits the templates to ones available in the package? It would avoid the extra step of having to ensure the template package is installed in the debug hive before we could install it.
What would be scenario?
1) dotnet new --install "/path/to/Aspnet.Web.v1.nupkg" --debug:disable-sdk-templates --debug:custom-hive "/path/to/hive"
1) dotnet new --install "/path/to/Aspnet.Web.v2.nupkg" --debug:disable-sdk-templates --debug:custom-hive "/path/to/hive"
1) dotnet new --install "/path/to/Aspnet.Web.v3.nupkg" --debug:disable-sdk-templates --debug:custom-hive "/path/to/hive"
1) dotnet new aspnetTemplate --debug:nupkg-path "/path/to/Aspnet.Web.v2.nupkg" --debug:disable-sdk-templates --debug:custom-hive "/path/to/hive"
And this would result in aspnetTemplate
to be used from "/path/to/Aspnet.Web.v2.nupkg" regardless of Precedence
or did you mean something else?
Would it help if we provided new command like dotnet new --uninstall --show-package aspnetTemplate
that would print out "/path/to/Aspnet.Web.v2.nupkg"?
Something along the lines of the last one:
dotnet new aspnetTemplate --debug:nupkg-path "/path/to/Aspnet.Web.v2.nupkg" -o <somedir>
and the engine essentially ignores specifically looks for templates in the nupkg, ignoring any installed templates and precedence rules. It would also help some of our development testing, since it means we could pack the templates and have it be created without going thru the extra steps of installing / clearing the template cache etc.
Oh now I understand, so you want to skip install step completely, makes sense
The uninstall step 😄. But yes, it would be super convenient to point to a nupkg and say please install a template from this archive.
I believe that since adding --debug:disable-sdk-templates
option it is possible for aspnet team to write performant integrations tests, hence closing this issue.
SDK: 6.0.100-preview.4.21214.10
List works but uninstall says no items are installed.
With an older SDK, the uninstall command provides helpful instructions on how to uninstall specific packages: