I have tried this solution, and applied the following formatting (changes where needed) to all files (Class\Class.cs, CodeFile\CodeFile.cs, Interface\Interface.cs, WebClass\CLass.cs):
namespace $rootnamespace$
{
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$
class $safeitemrootname$
{
}
}
My template files themselves look like so:
//
// Header
//
namespace $safeprojectname$
{
using x;
internal class Program
{
private static void Main(string[] args)
{
}
}
}
But once I create a new file with the template, my file ends up looking like so:
//
// Header
using x;
using y;
//
namespace MyNameSpace
{
internal class Program
{
private static void Main(string[] args)
{
}
}
}
It's not difficult to fix by hand, but I wish it could be done automatically