Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 2.16 KB

Setup.md

File metadata and controls

76 lines (50 loc) · 2.16 KB

 .NET Incubator Setup




Setup Visual Studio

  • Update the default C# Class in Visual Studio, everytime you create a new class it will use this template.
  • Open the following file in a text editor
C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\Class.cs

Change the template to the following, move using inside of the namespace and public before the class.

namespace $rootnamespace$;

using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$

public class $safeitemrootname$
{
}

Do the same with the Interface Template

C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\IDE\ItemTemplates\CSharp\Code\1033\Interface\Interface.cs
namespace $rootnamespace$;

using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$

public interface $safeitemrootname$
{
}

Browse to visualstudio.vssettings

At the bottom of Visual Studio click on the broom and choose Configure Code Cleanup. Choose everything except the bottom 2.

Note on any file you can press Ctr+K and then Ctrl+E to cleanup your code. This helps for consitency and clean code.

Intro