Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosIntel Devs: Smart AI Edge Solutions - 0 Introduction | Intel Software(22.09.2026 um 23:48 Uhr)
Windows Tipps & SecurityGoogles gibt Chrome 154 frei und schließt über 100 Lücken(23.09.2026 um 09:11 Uhr)
Windows Tipps & SecurityKlangerlebnis & Sicherheit im Vonovia Ruhrstadion(23.09.2026 um 08:45 Uhr)
Unix & Linux ServerLocal AI Jargon Quiz: Do You Know All These Buzzwords?(23.09.2026 um 08:38 Uhr)
Sichere ProgrammierungNeu von AWS: Weniger Kontextpflege für selbst gebaute KI-Agenten(23.09.2026 um 09:52 Uhr)
Sichere ProgrammierungLINQ GroupBy: The Operator Everyone Uses Wrong(23.09.2026 um 09:41 Uhr)
Sichere ProgrammierungIT Heard About the Acquisition Nine Days Before It Closed(23.09.2026 um 09:45 Uhr)
YouTube Security VideosIntel Devs: Smart AI Edge Solutions - 0 Introduction | Intel Software(22.09.2026 um 23:48 Uhr)
Windows Tipps & SecurityGoogles gibt Chrome 154 frei und schließt über 100 Lücken(23.09.2026 um 09:11 Uhr)
Windows Tipps & SecurityKlangerlebnis & Sicherheit im Vonovia Ruhrstadion(23.09.2026 um 08:45 Uhr)
Unix & Linux ServerLocal AI Jargon Quiz: Do You Know All These Buzzwords?(23.09.2026 um 08:38 Uhr)
Sichere ProgrammierungNeu von AWS: Weniger Kontextpflege für selbst gebaute KI-Agenten(23.09.2026 um 09:52 Uhr)
Sichere ProgrammierungLINQ GroupBy: The Operator Everyone Uses Wrong(23.09.2026 um 09:41 Uhr)
Sichere ProgrammierungIT Heard About the Acquisition Nine Days Before It Closed(23.09.2026 um 09:45 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Visual Studio custom project templates

Introduction Microsoft Visual Studio comes with many standard project templates, which leave developers to configure various aspects of a new project. Learn how to create custom project templates that provide starter code like preloaded…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Introduction



Microsoft Visual Studio comes with many standard project templates, which leave developers to configure various aspects of a new project.



Learn how to create custom project templates that provide starter code like preloaded NuGet packages, code to set up logging, defined settings for configuration files, and more.






Documentation



Rather than repeat all of Microsoft's documentation, see the following.








Preparation



Before jumping in, have a plan and be consistent across projects.



If the plan is to work across various project types, configuration files should have the same structure for connection strings, regardless of how connections might be accessed. Use the same format when implementing logging that writes to files. Being consistent across projects means going from project to project makes it easy to flow code and easy to maintain.



Consider when code is duplicated across projects, create NuGet packages, which makes maintenance easy.






Create two Visual Studio solutions



Create a Visual Studio solution for project templates and another for testing templates. By having two solutions, the test environment is not influenced by the templates. Also, there may be cases where a test project needs to be removed, but Visual Studio has a lock that can only be released by closing Visual Studio.






Create folder shortcut



Having this shortcut makes it easy to remove unwanted templates.




C:\Users\USERNAME\Documents\Visual Studio 2022\Templates\ProjectTemplates









Before creating a template



Before starting the template export process, create a meaningful template name and description for the following dialog box. The images are optional, as the template name and description are the most important aspects of identifying the templates.



Export Template wizard






Creating a single project template



The following instructions are from Microsoft.




  1. Create a project.

  2. Edit the project until it's ready to be exported as a template. For example, you might want to edit code files to indicate where parameter replacement should take place.

  3. On the Project menu, choose Export Template.

  4. On the Choose Template Type page, select Project Template. Select the project you want to export to a template, and then choose Next.

  5. On the Select Template Options page, enter a name and optional description, icon image, and preview image for your template. These items will appear in the dialog box where you create a new project. Select Finish.

  6. The project is exported into a .zip file and placed in the specified output location, and, if selected, imported into Visual Studio.



Once completed, move to Visual Studio for testing. Select Add new project, find the template, and add it to the solution. If NuGet packages are needed, wait for them to download.






Create multi-project templates



⚠️ The project name used will create a folder under the root folder so give it a meaningful name. There should be an option to place the projects at the root of the solution but in configuring the template this failed to work.



The following instructions are from Microsoft.



Multi-project templates act as containers for two or more Visual Studio projects. When you create a project that's based on a multi-project template, every project in the template is added to the solution.



The above documentation describes several variations; an example included with the source code has two class projects created in two solution folders.



The two project templates are in the root folder of the Visual Studio folder, named TwoProjectTemplateSample. To use them, copy the ConfigurationAndLogging.zip file to the template folder.



Add new project, type log to find the template.



Add new project dialog






After adding the two project template



results






Maintenance



As time passes, new .NET Core Frameworks are released, and new versions of NuGet packages are available. To handle these, either modify the template and redeploy or make the changes after adding the project to a solution.






Source code



Source code



All project templates have Serilog setup to write to a new folder each day, and appsettings.json is consistent across projects.

Sample projects






Summary



Custom templates can save a developer time and keep things consistent. Make sure to take time planning out and testing templates.






Item templates



To following in another article.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Visual Studio custom project templates

Thematisch verwandte Begriffe: Visual, Studio, custom, project · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96258 | A vulnerability has been found in onSite internet GmbH Auktion NG Auktio…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick