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

Install template issue #428

Closed
jochem4207 opened this issue Jul 2, 2023 · 11 comments
Closed

Install template issue #428

jochem4207 opened this issue Jul 2, 2023 · 11 comments
Labels
Enhancement New feature or request

Comments

@jochem4207
Copy link

Hey Neozhu,

I'm very happy this template exists and i'm going to try to make it work. I can download the code and that will probably work. But in the readme there is a section says dotnet new ca-blazor-sln. I don't have this command after running dotnet new --install sayedha.templates

I tried to create that template.json but that didn't add anything to having the 'ca-blazor-sln' command.

Can you help/provide explanation what I should do?

@neozhu neozhu added the Enhancement New feature or request label Jul 3, 2023
@neozhu
Copy link
Owner

neozhu commented Jul 3, 2023

To be honest, I don't yet have knowledge of how to create custom project templates, but I'll give it a try as it doesn't seem difficult. When I have time, I will improve this feature.

#429

@jochem4207
Copy link
Author

jochem4207 commented Jul 3, 2023

Thank you! That makes sense, we can't all know it. But it was in the readme so I assumed it was there.

Mainly i'm struggling / missing a simple how to get this project up and running for myself. Which docker commands in a simple step-by-step guide. Thats why I was trying the dotnet new ca-blazor-sln command.

Anyway thank you for building this template!

Edit: Somehow it started working after 2-3 tries, without docker, without magic. My question is solved. Ofcourse the template would be nice. But thats #429

@Bram1903
Copy link
Collaborator

Bram1903 commented Jul 3, 2023

Thank you! That makes sense, we can't all know it. But it was in the readme so I assumed it was there.

Mainly i'm struggling / missing a simple how to get this project up and running for myself. Which docker commands in a simple step-by-step guide. Thats why I was trying the dotnet new ca-blazor-sln command.

Anyway thank you for building this template!

Edit: Somehow it started working after 2-3 tries, without docker, without magic. My question is solved. Ofcourse the template would be nice. But thats #429

Having a template would indeed be really nice, however for now, you could go ahead and rename all the namespaces and the application name. I successfully was able to do it, so I believe in you ;-)

@neozhu
Copy link
Owner

neozhu commented Jul 3, 2023

What? Has the problem been resolved? Can projects be created using the template now?

@jochem4207
Copy link
Author

jochem4207 commented Jul 3, 2023

No, I can't create the template with a simple command (as in dotnet new ca-blazor-sln but the #429 was created so I figured the progress would be in there.

@Bram1903 I dont understand where your comment is coming from and why

Edit, apologies, I read it as I must redo all the namespaces like as a requirement. But it was just good advice you gave.

@Bram1903
Copy link
Collaborator

Bram1903 commented Jul 3, 2023

What? Has the problem been resolved? Can projects be created using the template now?

No, I meant that it is possible to manually rename the project including all of its corresponding namespaces. I successfully was able to do so at least. Obviously, a template would be better, since you don't have to go through the pain of changing everything manually, since it's an extremely annoying job. However, it is definitely possible to do it manually.

@neozhu
Copy link
Owner

neozhu commented Jul 3, 2023

I think you can now use templates to create your own projects, including new namespaces. I'll update the content of the readme, and some tests and adjustments may still need to be made.

@jochem4207
Copy link
Author

@neozhu thank you the update made it more clear! I am coming from this repo (https://github.com/jasontaylordev/CleanArchitecture and this guy put it in like the official library. So I was confused that I first had to download the repo, then create my own local .net template to install it somewhere else locally.

I would add the steps like

  1. Download/Clone this repo
  2. Unzip
  3. Run dotnet new install ./ //this puts the repo into a local .net template

(This all is in your implicit if I take a good look at your screenshot) but its not obvious to me as a new dotnet template user coming from a repo that has 1 line I need to execute.

@neozhu
Copy link
Owner

neozhu commented Jul 4, 2023

@neozhu thank you the update made it more clear! I am coming from this repo (https://github.com/jasontaylordev/CleanArchitecture and this guy put it in like the official library. So I was confused that I first had to download the repo, then create my own local .net template to install it somewhere else locally.

I would add the steps like

  1. Download/Clone this repo
  2. Unzip
  3. Run dotnet new install ./ //this puts the repo into a local .net template

(This all is in your implicit if I take a good look at your screenshot) but its not obvious to me as a new dotnet template user coming from a repo that has 1 line I need to execute.

I create a nuget library https://www.nuget.org/packages/CleanArchitecture.Blazor.Solution.Template/1.0.0-preview.1
and I add build package action to deploy to nuget when pushing the branch main.

I am not sure it's working.

@jochem4207
Copy link
Author

Seems to work perfectly for me

I ran dotnet new install CleanArchitecture.Blazor.Solution.Template::1.0.0-preview.1 and dotnet new ca-blazorserver-sln -n <MyProjectName>.

Seems to create the correct structure and everything.

@neozhu
Copy link
Owner

neozhu commented Jul 5, 2023

I found a minor issue; the Solution directory structure created by creating a new project menu in visual studio 2022 is different from the project structure in the source code. Please refer to the picture I have uploaded.
image

image

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

No branches or pull requests

3 participants