Orleans.FSharp.Analyzers 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Orleans.FSharp.Analyzers --version 1.0.0
                    
NuGet\Install-Package Orleans.FSharp.Analyzers -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Orleans.FSharp.Analyzers" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Orleans.FSharp.Analyzers" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Orleans.FSharp.Analyzers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Orleans.FSharp.Analyzers --version 1.0.0
                    
#r "nuget: Orleans.FSharp.Analyzers, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Orleans.FSharp.Analyzers@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Orleans.FSharp.Analyzers&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Orleans.FSharp.Analyzers&version=1.0.0
                    
Install as a Cake Tool

Orleans.FSharp.Analyzers

F# code analyzer that detects async {} computation expression usage and recommends task {} instead.

Why

Orleans is Task-native. Using async {} in grain code introduces unnecessary overhead from Async.StartAsTask conversions and can cause deadlocks on the grain's single-threaded scheduler. This analyzer catches async {} usage at edit-time so you can fix it before it reaches production.

Diagnostic

Code Severity Message
OF0001 Warning Use task {} instead of async {} for Orleans compatibility. Orleans is Task-native; async introduces overhead and potential deadlocks.

Opt-out

Apply [<AllowAsync>] to a method or property to suppress the diagnostic for that binding:

open Orleans.FSharp.Analyzers

[<AllowAsync>]
let legacyOperation () = async {
    // OF0001 suppressed here
    return! someAsyncLib ()
}

Installation

This analyzer is distributed via FSharp.Analyzers.SDK. To enable it:

  1. Install Orleans.FSharp.Analyzers as a NuGet reference.
  2. Configure your editor or build to load analyzers from the SDK path.

Refer to the FSharp.Analyzers.SDK docs for editor integration details.

How it works

The analyzer walks the untyped F# AST (ParsedInput) looking for SynExpr.App nodes where the function is SynExpr.Ident("async") applied to a SynExpr.ComputationExpr. Bindings decorated with [<AllowAsync>] or [<AllowAsyncAttribute>] are skipped.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 102 9/7/2026
5.0.0 105 9/7/2026
4.1.0 107 8/21/2026
4.0.2 112 8/20/2026
4.0.1 94 8/20/2026
4.0.0 100 8/19/2026
3.0.2 101 8/8/2026
3.0.1 134 6/29/2026
3.0.0 134 6/29/2026
2.0.0-alpha.1 91 4/28/2026
1.0.0 149 4/3/2026