Skip to content

Commit

Permalink
document what to do in case of multiple target frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
dawedawe committed Oct 30, 2023
1 parent 79da4aa commit bd4ad12
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/content/Getting Started Using.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ At last, you can run the analyzer from the project folder:
dotnet msbuild /t:AnalyzeProject
```
In case the output tells you there were no analyzers found and you have multiple targets defined in your `TargetFrameworks` property, you might have run into a situation in which there are multiple `$(PkgG-Research_FSharp_Analyzers)` variables and MSBuild doesn't know which one to use.
It should help to run the target with a defined target framework. Choosing the lowest is likely the safest thing to do.
For example, if you target `net6.0;net7.0`, run the target with:
```shell
dotnet msbuild /t:AnalyzeProject /p:TargetFramework=net6.0
```
## Using analyzers in a solution
Adding the custom target from above to all `.fsproj` files of a solution doesn't scale very well.
Expand Down

0 comments on commit bd4ad12

Please sign in to comment.