dotnet-vslint 1.2.1

Additional Details

No longer needed for SDK style projects.

dotnet tool install --global dotnet-vslint --version 1.2.1                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local dotnet-vslint --version 1.2.1                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-vslint&version=1.2.1                
nuke :add-package dotnet-vslint --version 1.2.1                

VSLint

NuGet Build

VSLint is a command line tool used for detecting issues in Visual Studio project files.

Features

VSLint scans for the following issues.

Classic project format Modern project format
Duplicate file references Yes Yes
Missing files Yes Yes
Files on disk not included in project Yes No

It will also try to locate .gitignore and .hgignore files and use them to try to avoid false positives.

Limitations

Due to the complexity VSLint will not parse conditional includes or targets files.

Complex .gitignore GLOBs may not be parsed properly, internally GLOBs are converted to regular expressions with a pretty naive implementation that works in most cases. For example, negated patterns are not honored.

Command line usage

> vslint --help
vslint, a tool for detecting inconsistencies in Visual Studio project files
Usage: vslint [options..] path [path2 path3 ..]

Options:
-h, --help              Prints this help message
-m, --machine-readable  Print results in an alternate machine readable format
-v, --verbose           Lists scanned projects even if no issues are found
-q, --quiet             Quiet unless issues are found

> vslint -v
Project .\vslint\vslint.fsproj
  no issues

Project .\vslint.Tests\vslint.Tests.fsproj
  no issues

Found 0 issues

Use as commit hook

VSLint can be used as a pre commit hook in either git or Mercurial to prevent commits with errors in project files that may, for instance, arise in auto merges.

For use with git, add vslint.exe to your path and create a .git/hooks/pre-commit file with the following contents.

#!/bin/bash

vslint

For use with Mercurial, add vslint.exe to your path and add the following to your .hg/hgrc file.

[hooks]
precommit =
precommit.vslint = vslint

Ignored files and folders

Even if you don't have a .gitignore or .hgignore some files and folders are ignored by default.

Folders

  • .git
  • .hg
  • .svn
  • bin
  • obj
  • packages

Files

  • .gitignore
  • .hgignore
  • .sln
  • .csproj
  • .fsproj
  • .vbproj
  • .targets
  • .suo
  • .user
  • .orig

.vslintignore

If you have additional files that should be ignored you may add a file named .vslintignore with one regular expression per line.

Lines starting with # are comments, empty lines are ignored.

Sample

# Ignore powershell files
\.ps(m|1)$

# Ignore ReSharper files
_ReSharper\.*/
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.