Forum Visual Studio

Add custom file templates

ZiLZiL USMember
edited October 2015 in Visual Studio


I've been using Xamarin Studio for about 4 months now and I've been bothered by this.

Where can I create a template file ? I often want to add a new file, and I'm forced to use the default "Empty class" file, for example, where I would like to add very specific file instead.

More specifically, for the sake of giving an example, I'll often create unit-tests classes that inherit from a project specific baseclass. Right now, I can not :

  • Create a default unit-test class from the new file option.
  • Create a custom file from the new file option, based on a "currently opened file" or "file from disk", for example.
  • Save that template as a new template for that solution, or even forever in XamarinStudio.
  • Manage/Move/Remove/Edit folders and template files given in the currently default list of "Add New File".

My questions are :

Is this already available, if so, where?
If not, is it already in your pipeline of future features?

This would be really great as, typically, we create about 150 test classes that have the exact same starting layout (test fixture, setup, teardown, and so on).

Having the test class in the template would be a plus, behing able to add stuff myself would be best, as most developers will probably use those classes differently.

Best Answer


  • ZiLZiL USMember

    Okay thanks.
    I did not think of browsing through the files of the Xamarin Studio package but now I've found plenty of .xml files I can fiddle around with :)

    Though that would be nice to have an IDE feature allowing this, maybe simply by adding an "Edit template" button that loads the specific .xml

Sign In or Register to comment.