rehansaeed.github.io icon indicating copy to clipboard operation
rehansaeed.github.io copied to clipboard

[Comment] Custom Visual Studio Project Templates

Open RehanSaeed opened this issue 5 years ago • 6 comments

https://rehansaeed.com/custom-visual-studio-project-templates/

RehanSaeed avatar May 12 '20 10:05 RehanSaeed

B. Clay Shannon B. Clay Shannon commented on 2014-12-12 15:43:53

Is it possible to create a project template that has Nuget packages added (such as for Bing Maps, SQlite, sqlite-net, etc.)?

BTW, I like your retro sci-fi font.

RehanSaeed avatar May 12 '20 10:05 RehanSaeed

Rehan Rehan commented on 2014-12-12 16:25:14

Is it possible to create a project template that has Nuget packages added (such as for Bing Maps, SQlite, sqlite-net, etc.)?

BTW, I like your retro sci-fi font.

Of course it is. You don't need to include the NuGet packages themselves. The key is the packages.config file, you just need to include it in your project template. When Visual Studio first loads the project and sees the NuGet packages installed from the packages.config but does not see that they are loaded, it will download them all for you.

If you want an example, go ahead and download the code for ASP.NET Core Boilerplate (It's very simple, only three projects). You can set the bottom VSIX project as the startup project, hit F5 to start and see what happens.

Thanks for the comment about the font, I added it because it's unusual.

Good Luck!

RehanSaeed avatar May 12 '20 10:05 RehanSaeed

Data Juggler Data Juggler commented on 2014-12-18 22:29:58

Thanks for the article; I watched the video on the Side Waffle site; is Side Waffle similar to Nuget? It looks like it does the same thing.

If you want to do a part 2 on 'Working With Multiple Projects and Solution Folders', it is always a pain for me to set them up; it has been on my to do list to build a Package Deployment solution for multiple projects for a long time; It seems to take me forever to export one of our solutions that contains over a dozen projects.

RehanSaeed avatar May 12 '20 10:05 RehanSaeed

Rehan Rehan commented on 2014-12-19 07:17:16

Thanks for the article; I watched the video on the Side Waffle site; is Side Waffle similar to Nuget? It looks like it does the same thing.

If you want to do a part 2 on 'Working With Multiple Projects and Solution Folders', it is always a pain for me to set them up; it has been on my to do list to build a Package Deployment solution for multiple projects for a long time; It seems to take me forever to export one of our solutions that contains over a dozen projects.

I'm no expert but SideWaffle seems to be an alternative to the Visual Studio Gallery. You install the SideWaffle extension and you get some project templates and item templates added to your 'New Project' dialogue.

I haven't looked into doing multiple projects in one project template yet but in theory it should be pretty easy. There is a special project XML node in the .vstemplate file that you need to use. If you want to do multiple project templates in one extension, then that is super easy. You just need to create a new C# VSIX Project, follow my instructions for it and add it as another reference in the VSIX project. Not sure if I'll write another article, this one was a by-product of having to create a VSIX for the ASP.NET Core Boilerplate project I'm working on. I just found it really hard to find any good up to date articles on the subject, so naturally I wrote a blog post.

RehanSaeed avatar May 12 '20 10:05 RehanSaeed

Anand Anand commented on 2017-04-05 20:44:42

Hi, I have a project template created but I'm trying to explore the option to have this converted as nuget package. the idea is that next person has to just get the nuget and basic project skeleton will be set. Is it possible?

RehanSaeed avatar May 12 '20 10:05 RehanSaeed

Rehan Rehan commented on 2017-04-08 08:46:37

Hi, I have a project template created but I'm trying to explore the option to have this converted as nuget package. the idea is that next person has to just get the nuget and basic project skeleton will be set. Is it possible?

It is with dotnet new based project templates.

RehanSaeed avatar May 12 '20 10:05 RehanSaeed