FrendsTaskAnalyzers 1.11.0
dotnet add package FrendsTaskAnalyzers --version 1.11.0
NuGet\Install-Package FrendsTaskAnalyzers -Version 1.11.0
<PackageReference Include="FrendsTaskAnalyzers" Version="1.11.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="FrendsTaskAnalyzers" Version="1.11.0" />
<PackageReference Include="FrendsTaskAnalyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add FrendsTaskAnalyzers --version 1.11.0
#r "nuget: FrendsTaskAnalyzers, 1.11.0"
#:package FrendsTaskAnalyzers@1.11.0
#addin nuget:?package=FrendsTaskAnalyzers&version=1.11.0
#tool nuget:?package=FrendsTaskAnalyzers&version=1.11.0
FrendsTaskAnalyzers
Package of Roslyn analyzers designed to help in the development of Frends tasks by enforcing conformance to task development guidelines and best practices.
Installation
The recommended way to add the analyzers to your task project is
by adding the NuGet package as a PackageReference in your .csproj.
This ensures the analyzers are automatically active during development and build processes.
<PropertyGroup>
<PackageReference Include="FrendsTaskAnalyzers" Version="*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</PropertyGroup>
Configuration
After installation, you need to tell the analyzers which methods in your code are task methods.
There are two ways of doing this:
Using FrendsTaskMetadata.json (Recommended)
This is the simplest and recommended way to configure the analyzers.
The FrendsTaskMetadata.json file is a standard part of Frends tasks,
and the analyzers can use it to automatically discover the task methods.
To enable this,
ensure the FrendsTaskMetadata.json file is included as an AdditionalFiles item in your .csproj file.
<ItemGroup>
<AdditionalFiles Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AdditionalFiles>
</ItemGroup>
Using .editorconfig
Alternatively, you can specify the task methods in your .editorconfig file.
This is useful if you cannot change the FrendsTaskMetadata.json file to an AdditionalFiles item.
Add the frends_task_analyzers.task_methods key to your .editorconfig file with a semicolon-separated list of your
complete task method names.
[*.cs]
frends_task_analyzers.task_methods = Frends.Echo.Execute.Echo.Execute;Frends.Echo.Execute.Echo.Execute2
Alternative Usage: Roslynator CLI
If you cannot add a PackageReference to your project,
you can run the analyzers using the Roslynator CLI.
You will need to configure the task methods using an .editorconfig file as described above,
unless FrendsTaskMetadata.json is already configured as an AdditionalFiles item.
- Install Roslynator CLI tool:
dotnet tool install -g Roslynator.DotNet.Cli
- Acquire analyzer DLLs: Download the FrendsTaskAnalyzers NuGet package from the NuGet feed or a GitHub release. Unzip the DLL files from the package to a local directory.
unzip -o -j -d analyzers FrendsTaskAnalyzers.nupkg *.dll
- Run analysis: Execute Roslynator from your project's directory, providing the path to the analyzer assemblies.
roslynator analyze --analyzer-assemblies /path/to/analyzers
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.11.0)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.