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

Update docs on how to create a dotnet cli template package with dotnet pack #8018

Closed
zivkan opened this issue Apr 18, 2019 · 7 comments
Closed

Update docs on how to create a dotnet cli template package with dotnet pack #8018

zivkan opened this issue Apr 18, 2019 · 7 comments
Labels
Milestone

Comments

@zivkan
Copy link
Member

@zivkan zivkan commented Apr 18, 2019

The following docs page says this: https://docs.microsoft.com/en-us/dotnet/core/tools/custom-templates#packing-a-template-into-a-nuget-package-nupkg-file

Currently, a custom template is packed on Windows with nuget.exe (not dotnet pack). For cross-platform packaging, consider using NuGetizer 3000.

We should update the docs to explain how to pack with dotnet pack.

@zivkan zivkan added the Type:Docs label Apr 18, 2019
@zivkan zivkan added this to the Backlog milestone Apr 18, 2019
@Thraka

This comment has been minimized.

Copy link

@Thraka Thraka commented Jun 4, 2019

If someone can give me the steps, I can update the doc to describe it.

@zivkan

This comment has been minimized.

Copy link
Member Author

@zivkan zivkan commented Jun 5, 2019

@Thraka it involves some investigation. My guess is the only reason they say it's necessary to use nuget.exe is because they use the <packageType> element. The other fields they have in the table are definately possible to set in the csproj. So, we should check nuget pack targets to see whether or not it's possible to specify the package type in a csproj. If not, test if putting a nuspec in the csproj directory allows the package to be packed correctly with dotnet pack.

@Thraka

This comment has been minimized.

Copy link

@Thraka Thraka commented Jun 5, 2019

I've figured it out after a ton of trial and error. I'm going to be removing various variables to determine the minimum needed to get this working.

@Thraka

This comment has been minimized.

Copy link

@Thraka Thraka commented Jun 5, 2019

Is there a spec on template.json?

@Thraka

This comment has been minimized.

Copy link

@Thraka Thraka commented Jun 5, 2019

I found the wiki at https://github.com/dotnet/templating/wiki which has a bunch of info

@nkolev92 nkolev92 added ToBeMoved and removed ToBeMoved labels Feb 4, 2020
@jchannon

This comment has been minimized.

Copy link

@jchannon jchannon commented Feb 13, 2020

I just got this working thanks to @sayedihashimi with the following command

dotnet pack ./content/CarterTemplate.csproj -p:nuspecfile=/Users/jonathan/projects/carter/template/cartertemplate.nuspec

You can try it out from this repo https://t.co/J7jcxS2Goo

Hopefully this info can help the docs

NOTE: the nuspecfile has to be a full path

@zivkan

This comment has been minimized.

Copy link
Member Author

@zivkan zivkan commented Feb 13, 2020

Double-checking .NET Core's docs on packing templates, they've already updated it to show how to pack using nothing more than the dotnet cli and a csproj. No custom nuspec, no nuget.exe.

Closing this issue as it's complete.

@zivkan zivkan closed this Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.