FarNet.template 1.2.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet new install FarNet.template::1.2.0
This package contains a .NET Template Package you can call from the shell/command line.

FarNet.template

FarNet module template for C# and F# projects

With .NET SDK installed with Visual Studio 2017+ or manually, the easiest way to create module projects for FarNet is using FarNet.template from the NuGet gallery.

Projects created from the template can be used for development and debugging in Visual Studio and VSCode.

.NET Core is not supported at the moment, see #16.

To install the FarNet module template from the NuGet gallery, run:

dotnet new -i FarNet.template

Take a look at all templates:

dotnet new -l

The list should contain "FarNet module":

Templates       Short Name   Language   Tags
-----------------------------------------------------
FarNet module   farnet       [C#], F#   FarNet/Module

Then you can create projects using the installed template.

To create a C# (default) or F# module project, create a new folder with your module name, change to it, and run:

dotnet new farnet
dotnet new farnet -lang F#

After creating a project take a look at its README.md. It describes the generated assets, tells how to use, debug, etc.

To uninstall the template, run:

dotnet new -u FarNet.template

FarNet module created from template

Before opening created projects in Visual Studio or VSCode ensure you have the environment variable FARHOME set to the Far Manager directory. If it is missing then the development location C:\Bin\Far\x64 is used, see the project file and change if needed. If you start Visual Studio or VSCode from Far Manager then FARHOME is set.

Visual Studio

The project is ready to use in Visual Studio.

VSCode

Requirements:

Project content

  • .vscode
    • launch.json - VSCode debug settings
    • tasks.json - VSCode build task
  • Properties
    • launchSettings.json - Visual Studio debug settings
  • Name.csproj or Name.fsproj - project file
  • README.md - documentation file
  • Host.cs or Host.fs - optional module host
  • Tool1.cs or Tool1.fs - plugin menu item "Hello"

All projects have references to FarNet and FarNet.Tools.

F# projects have references to the mandatory FSharp.Core.dll and optional FarNet.FSharp.dll. These assemblies are installed together with the module FarNet.FSharpFar.

You may remove not used optional references but they are harmless.

When you build a project the post build step copies built files to the FarNet module directory. Ensure Far Manager is not running to avoid files in use.

The module created from the template adds a "Hello" item to the Far Manager plugin menus. This item shows a message box.

Debugging

Press [F5] to starts debugging of your module. Debug modes:

  • Start Far (Visual Studio, VSCode default mode)
    • The build step is called at first and then debugging starts. Far.exe should be in the path or you should adjust settings.
  • Attach single Far (select in VSCode)
    • Attach to the already running single Far.exe.
  • Attach selected Far (select in VSCode)
    • Choose one of the several running Far.exe.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.0 3,160 11/19/2023
4.0.3 373 4/8/2023
4.0.2 443 1/2/2023
4.0.1 333 11/19/2022
4.0.0 293 11/19/2022
3.0.2 433 10/18/2022
3.0.1 425 10/13/2022
3.0.0 399 10/8/2022
2.2.0 474 8/25/2022
2.0.1 444 7/31/2022
2.0.0 426 7/19/2022
1.3.0 456 6/11/2022
1.2.1 404 6/10/2022
1.2.0 408 6/10/2022
1.1.0 411 6/3/2022
1.0.3 460 2/12/2022
1.0.2 2,437 12/26/2020
1.0.1 537 12/19/2019
1.0.0 549 12/15/2019
0.0.4 1,311 9/3/2018
0.0.2 1,172 3/23/2018
0.0.1 936 3/19/2018

Add Host.cs, Host.fs, README.md.