SharpView 0.4.1

dotnet add package SharpView --version 0.4.1
                    
NuGet\Install-Package SharpView -Version 0.4.1
                    
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="SharpView" Version="0.4.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpView" Version="0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="SharpView">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 SharpView --version 0.4.1
                    
#r "nuget: SharpView, 0.4.1"
                    
#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 SharpView@0.4.1
                    
#: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=SharpView&version=0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=SharpView&version=0.4.1
                    
Install as a Cake Tool

SharpView (MSBuild package)

Reports SharpView's exception findings as build warnings after each build: in dotnet build, Visual Studio's Error List and VS Code's Problems panel. Build agents need nothing extra; dotnet restore brings it.

The usual way to run SharpView is the SharpView.Cli tool, in CI or on demand: dotnet sharpview exceptions MyApi.slnx --format msbuild prints the same warnings without adding seconds to every build. Use this package when you want them in every build without anyone running the tool.


<ItemGroup>
  <PackageReference Include="SharpView" Version="x.y.z" />
</ItemGroup>
Code Finding
SV0001 An exception may escape a controller action: no catch on the way.
SV0002 The same, but a global exception handler (exception middleware or filter) receives it.
SV0003 A throw passes through a try whose catch clauses do not match its type.
SV0004 A third-party call with no catch on the way from the action (only with --strict).
SV0000 The analysis itself failed; build with -v:n to see why.

Each warning points at the throw (SV0001/2), the try (SV0003) or the call (SV0004), and names the actions and one example path. Interface and virtual calls are followed into their source implementations; such paths say "possible, not proven".

Suppressing one finding

Use the C# suppression forms where the warning points (the throw, the try or the call):

#pragma warning disable SV0003 // ArgumentException is the only one we can recover from here
try { Load(); } catch (ArgumentException) { }
#pragma warning restore SV0003

[SuppressMessage("SharpView", "SV0002:Mapped to 404 by middleware")]
public Order Find(int id) => orders.Get(id) ?? throw new NotFoundException(id);

A pragma covers the code up to its restore (or the end of the file); an attribute covers the method, property or type it is on. Assembly-level [assembly: SuppressMessage] is not read. The build log counts suppressed warnings. If the IDE flags these as unnecessary suppressions (IDE0079), add dotnet_remove_unnecessary_suppression_exclusions = SV0001,SV0002,SV0003,SV0004 to .editorconfig.

Settings

<PropertyGroup>
  
  <NoWarn>$(NoWarn);SV0002</NoWarn>
  
  <WarningsAsErrors>$(WarningsAsErrors);SV0001</WarningsAsErrors>
  
  <SharpViewEnabled Condition="'$(CI)' != 'true'">false</SharpViewEnabled>
  
  <SharpViewInput>$(MSBuildThisFileDirectory)../MyApi.slnx</SharpViewInput>
  
  <SharpViewArguments>--strict</SharpViewArguments>
</PropertyGroup>

The analysis loads the whole project graph, so it adds seconds to every build. It does not run during the IDE's background design-time builds, and warnings appear after a build, not while typing. Requires a .NET 10 (or newer) SDK. For the command-line tool, install SharpView.Cli (dotnet tool install -g SharpView.Cli). Licensed under MIT.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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
0.4.1 5 10/25/2026
0.4.0 35 10/25/2026
0.3.1 38 10/25/2026
0.3.0 55 10/24/2026
0.2.1 59 10/24/2026
0.2.0 66 10/21/2026
0.1.2 69 10/20/2026
0.1.1 65 10/20/2026
0.1.0 67 10/19/2026
0.0.1 76 10/18/2026