https://github.com/smalls1652/smallsonline.dotnet.templates
https://github.com/smalls1652/smallsonline.dotnet.templates
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/smalls1652/smallsonline.dotnet.templates
- Owner: Smalls1652
- License: mit
- Created: 2021-12-14T15:51:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T11:00:03.000Z (12 months ago)
- Last Synced: 2025-04-04T13:12:50.160Z (6 months ago)
- Language: Dockerfile
- Size: 124 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Smalls.Online Dotnet Templates
This repository contains my own personal templates to use with `dotnet new`.
## Templates Included
### SmallsOnline.Csharp.ClassLib
A bare-bones C# class library.
#### Short name
`smallsonline-classlib`
#### Template structure
```
DirectoryName/
|
|___helpers/
| |___Helper.cs
|
|___models/
| |___Model.cs
|
|___DirectoryName.csproj
```### SmallsOnline.Csharp.AzFunctions.Isolated
A C# template for an Azure Functions project running in an isolated/out-of-process environment.
#### Short name
`smallsonline-azfunction-isolated`
#### Template structure
```
DirectoryName/
|
|___functions/
| |___GetTest.cs
|
|___ _Imports.cs
|___host.json
|___local.settings.json
|___Program.cs
|___DirectoryName.csproj
```## Creating the templates package
### `dotnet` CLI
```
dotnet pack --configuration "Release" --output ".\_build\"
```### PowerShell
```powershell
.\createPkg.ps1
```The output will be located in the `.\_build\` folder.
### VSCode Build Task
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`
- Run the build task from the command palette:
1. Open the command palette
- **Windows/Linux**: `Shift + Ctrl + P`
- **macOS**: `Shift + Command + P`
2. Type in `Tasks: Run Build Task` and press the `Enter` key.
- Run the task from the command palette:
1. Open the command palette
- **Windows/Linux**: `Shift + Ctrl + P`
- **macOS**: `Shift + Command + P`
2. Type in `Tasks: Run Task` and press the `Enter` key.
3. Select the task **Create package** and press the `Enter` key.The output will be located in the `.\_build\` folder.
## Installing the templates package
1. 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 the `dotnet` command in it.
2. 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**: The `SmallsOnline.Dotnet.Templates.2021.12.0.nupkg` can be different depending on the version of the templates package itself.