Author Topic: Visual Studio Project Template  (Read 6428 times)

0 Members and 1 Guest are viewing this topic.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2123
  • class keyThumper<T>:ILazy<T>
Visual Studio Project Template
« on: June 11, 2017, 12:02:22 AM »

a bookmark:

Playing with Project Templates for VS 2017 ...

templates are Zipped by Visual Studio ...  saves in 2 places

in ProjectTemplates used by VS
and a backup in My Exported Templates

I had some templates that continued to show in the project startup dialog after they had been deleted from the default locations.

I tracked the cached location to
C:\Users\kdub_\AppData\Roaming\Microsoft\VisualStudio\15.0_dc662b10\ProjectTemplatesCache\ ....
Deleting the cached zips has fixed the issue.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Visual Studio Project Template
« Reply #1 on: June 11, 2017, 03:53:04 AM »
Hi,

Thanks for sharing.

I have not tried Visual Studio 2017 yet, but I never noticed this with prior version of Visual Studio. Adding or removing template ZIP files from the "Templates\Project Templates" folder (or one of its subfolder) does the trick.

Some templates to try here.
Speaking English as a French Frog

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2123
  • class keyThumper<T>:ILazy<T>
Re: Visual Studio Project Template
« Reply #2 on: June 11, 2017, 05:38:11 AM »
Thanks Gilles,

That looks interesting.

I'm having difficulty with the new Templates I've built  in vs2017... VS does not seem to recognise them ie: they are not being listed in the template dialog.

I'll have another play next weekend

Regards,
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.


gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Visual Studio Project Template
« Reply #4 on: June 11, 2017, 11:14:30 AM »
Here's a translation of the French tutorial I wrote to create an AutoCAD template.
The translation is mainly done with the Miscrosoft Word Translator, so let me know if there're still mistakes.

Create a C# Template for AutoCAD with Visual Studio 2015
Speaking English as a French Frog

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Visual Studio Project Template
« Reply #5 on: June 29, 2017, 06:26:24 PM »
Hi,

I finally take the time to install and give a try to VS 2017.

I simply copy / paste the templates from VS 2015 Templates\Project Templates to the same VS 2017 folder and all seems to work fine.

I also did the same with my code snippets with succes.
Speaking English as a French Frog

DavidS

  • Mosquito
  • Posts: 15
Re: Visual Studio Project Template
« Reply #6 on: June 30, 2017, 09:51:28 AM »
Hi,

I finally take the time to install and give a try to VS 2017.

I simply copy / paste the templates from VS 2015 Templates\Project Templates to the same VS 2017 folder and all seems to work fine.

I also did the same with my code snippets with succes.

Gile,

Since one of your favorite languages is F#, you should enjoy where C# 7 and 8 are heading with pattern matching...

https://www.youtube.com/watch?v=KFqrp4KSxio

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Visual Studio Project Template
« Reply #7 on: June 30, 2017, 10:22:53 AM »
Hi,

I finally take the time to install and give a try to VS 2017.

I simply copy / paste the templates from VS 2015 Templates\Project Templates to the same VS 2017 folder and all seems to work fine.

I also did the same with my code snippets with succes.

Gile,

Since one of your favorite languages is F#, you should enjoy where C# 7 and 8 are heading with pattern matching...

https://www.youtube.com/watch?v=KFqrp4KSxio

Yes thanks, I already saw this video, but I gave a try and found C#7 pattern matching is really not as powerfull as F# one.
Speaking English as a French Frog

DavidS

  • Mosquito
  • Posts: 15
Re: Visual Studio Project Template
« Reply #8 on: June 30, 2017, 01:34:32 PM »
...
...
Yes thanks, I already saw this video, but I gave a try and found C#7 pattern matching is really not as powerfull as F# one.

I agree about the power of pattern matching with F#, but I'm not very effective with F# yet.  Anyway, the switch statement and the case block expressions using "when" for pattern matching should help cut down of some of the C# verbiage.

Sorry about sidetracking the conversation away from the topic.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Visual Studio Project Template
« Reply #9 on: June 30, 2017, 02:11:23 PM »
Still off topic, a little comparison using some new C# features (local function, tuples and pattern matching).

C#
Code - C#: [Select]
  1. static void PrintDivRem(int a, int b)
  2. {
  3.     (int quot, int rem) divRem(int x, int y) => (x / y, x % y);
  4.  
  5.     switch (divRem(a, b))
  6.     {
  7.         case var x when x.rem == 0:
  8.             WriteLine($"{b} x {x.quot} = {a}");
  9.              break;
  10.          case var x:
  11.             WriteLine($"{b} x {x.quot} + {x.rem} = {a}");
  12.             break;
  13.     }
  14. }

F#
Code - F#: [Select]
  1. let printDivRem a b =
  2.     let divRem x y = (x / y, x % y)
  3.    
  4.     match divRem a b with
  5.     | (q, 0) -> printfn "%d x %d = %d" b q a
  6.     | (q, r) -> printfn "%d x %d + %d = %d" b q r a
Speaking English as a French Frog

DavidS

  • Mosquito
  • Posts: 15
Re: Visual Studio Project Template
« Reply #10 on: June 30, 2017, 03:00:44 PM »
Still off topic, a little comparison using some new C# features (local function, tuples and pattern matching).
...

Thanks for the comparison and you also showed deconstruction.