Comments (6)
I am using Visual Studio 2022 Community and my template files are not located in the installation folder but in the AppData
folder:
%userfolder%\AppData\Local\Microsoft\VisualStudio\17.0_6e63176c\Extensions\jxnhm1ga.wt4\Templates
from addanyfile.
Hey guys, I found that you can add your own templates as is (v3.5.134) by creating new files in the following folder (the extension's installation path).
%localappdata%\Microsoft\VisualStudio\15.0_f5f2761e\Extensions\3duco4g1.iyl\Templates
The only problem is that when the extension updates, I believe my own templates will be removed (correct?). Therefore I was wondering what if we extend the search for templates to an additional folder outside of the installation path (Templatemap.cs), ideally a folder of my choice. We can add said folder-path in the Visual Studio > Tools > Option > File Nesting > General
dialog.
What do you guys think?
from addanyfile.
Thanks @Ackara for the hint. That worked.
If you need to find the correct folder (there are a lot different), use the following:
- Navigate to
%localappdata%\Microsoft\VisualStudio
- Go to the highest version folder (like 14.0, 15.0)
- Go to the
Extensions
folder - Search for
AddAnyFile
. You should find e.g. the dll. You can navigate to it's folder through the right click menu (Open in explorer) - Navigate to the
Templates
folder - Edit the templates
from addanyfile.
Back around v2.6 of this extension, I sent a PR that implemented support for VS Item Templates. The PR was merged but after few subsequent releases the code for VS Template support was dropped.
If you would like to use that behavior and don't mind losing features between 2.6 and now (and gain a few other features like automatic file extension inclusion based on project type), you can try the extension from my fork
https://github.com/sameera/AddAnyFile
If you need VS 2017 support, please pull from "dev" branch and build in VS 2017.
from addanyfile.
This would be graet, if you can make it available so that you can use convension based names to resolve a template that is produced in every project.
if i create _Template_Service.cs when i create i file like MyCusotmService.cs it should resolve to that template.
this would mean that you can create lots of templates that would make producing context quicker.
from addanyfile.
The code in the above branch already has regex based template mappings and you can customize to what you want.
from addanyfile.
Related Issues (20)
- Support for XAML HOT 1
- New template for .razor.cs files for Blazor HOT 2
- File scoped namespace option has a typo in the template when generating a "razor.cs" file
- [REQUEST] Templates for specific folders.
- [REQUEST] Optional parameters passed into template.
- [REQUEST] Optional limitation of namespace parts
- 🐛 Bug adding a new C# enum file HOT 1
- Custom templates dollar ($) symbol HOT 1
- Visual Studio 17.4 Preview 4+ breaks Add New File HOT 17
- Add missing Microsoft.AspNetCore.Mvc reference for controller template
- After creating files, point VS focus to code editor window instead of Solution Explorer HOT 2
- Creating empty .cs files HOT 1
- VS2022 pro .templates don't show up. HOT 1
- Can't create C# interface file w/ .cs template
- Classes created as 'Internal' by default HOT 2
- Mads: I reported this to MS VS Team but here is what I found. HOT 3
- Add Record
- Changed behavior in vs2022 HOT 2
- Will not install on VS2022 arm64 HOT 2
- Questions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addanyfile.