This repository contains my own personal templates to use with dotnet new
.
A bare-bones C# class library.
smallsonline-classlib
DirectoryName/
|
|___helpers/
| |___Helper.cs
|
|___models/
| |___Model.cs
|
|___DirectoryName.csproj
A C# template for an Azure Functions project running in an isolated/out-of-process environment.
smallsonline-azfunction-isolated
DirectoryName/
|
|___functions/
| |___GetTest.cs
|
|___ _Imports.cs
|___host.json
|___local.settings.json
|___Program.cs
|___DirectoryName.csproj
dotnet pack --configuration "Release" --output ".\_build\"
.\createPkg.ps1
The output will be located in the .\_build\
folder.
You can create the package in Visual Studio code by running the build task.
- Use the Run Build Task shortcut key combo:
- Windows/Linux:
Shift + Ctrl + B
- macOS:
Shift + Command + B
- Windows/Linux:
- Run the build task from the command palette:
- Open the command palette
- Windows/Linux:
Shift + Ctrl + P
- macOS:
Shift + Command + P
- Windows/Linux:
- Type in
Tasks: Run Build Task
and press theEnter
key.
- Open the command palette
- Run the task from the command palette:
- Open the command palette
- Windows/Linux:
Shift + Ctrl + P
- macOS:
Shift + Command + P
- Windows/Linux:
- Type in
Tasks: Run Task
and press theEnter
key. - Select the task Create package and press the
Enter
key.
- Open the command palette
The output will be located in the .\_build\
folder.
- Open up your terminal prompt and navigate to the cloned repo directory on your computer.
- You can use
powershell
,pwsh
,cmd
,bash
,zsh
, etc. Just as long as you can run thedotnet
command in it.
- You can use
- Run the following command:
- Windows:
dotnet new --install .\_build\SmallsOnline.Dotnet.Templates.2021.12.0.nupkg
- macOS/Linux:
dotnet new --install ./_build/SmallsOnline.Dotnet.Templates.2021.12.0.nupkg
⚠️ Note: TheSmallsOnline.Dotnet.Templates.2021.12.0.nupkg
can be different depending on the version of the templates package itself.
- Windows: