diff --git a/docs/guide/Advanced/STAThread.md b/docs/guide/Advanced/STAThread.md new file mode 100644 index 000000000..f9d537afc --- /dev/null +++ b/docs/guide/Advanced/STAThread.md @@ -0,0 +1,16 @@ +# STAThread + +If the code you want to benchmark requires `[System.STAThread]` then you need to apply this attribute to the benchmarked method. BenchmarkDotNet will generate executable with `[STAThread]` applied to it's `Main` method. + +## Example + +```cs +[Benchmark, System.STAThread] +public void CheckForSTA() +{ + if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) + { + throw new ThreadStateException("The current threads apartment state is not STA"); + } +} +``` diff --git a/docs/guide/Contributing/Miscellaneous.md b/docs/guide/Contributing/Miscellaneous.md index 063663f98..35aa0e8d6 100644 --- a/docs/guide/Contributing/Miscellaneous.md +++ b/docs/guide/Contributing/Miscellaneous.md @@ -9,7 +9,7 @@ We have full F# support, all you have to do is to run `dotnet restore` to downlo ## How can I help? -Here is a list of up-for-grabs issues: https://github.com/PerfDotNet/BenchmarkDotNet/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs +[Here is a list of up-for-grabs issues](https://github.com/PerfDotNet/BenchmarkDotNet/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs) ## Nightly NuGet feed diff --git a/docs/guide/Contributing/RunningTests.md b/docs/guide/Contributing/RunningTests.md index 91e1e269d..134d0f355 100644 --- a/docs/guide/Contributing/RunningTests.md +++ b/docs/guide/Contributing/RunningTests.md @@ -1,6 +1,6 @@ # Running Tests -* To run "Classic" tests build the solution and run runClassicTests.cmd in the root directory or comment out the `netcoreapp1.0` part of all project.json files +* To run "Classic" tests build the solution and run runClassicTests.cmd in the tests directory or comment out the `netcoreapp1.0` part of all project.json files that belong to the testing projects. * To run "Core" tests you just need to open Test Explorer in Visual Studio and rebuild the solution. Then tests show up in Test Explorer and you can simply run them. diff --git a/docs/guide/docnet.json b/docs/guide/docnet.json index 24796612d..997cd1c3c 100644 --- a/docs/guide/docnet.json +++ b/docs/guide/docnet.json @@ -27,7 +27,8 @@ "Params": "Advanced\\Params.md", "Setup":"Advanced\\Setup.md", "Baseline":"Advanced\\Baseline.md", - "Percentiles":"Advanced\\Percentiles.md" + "Percentiles": "Advanced\\Percentiles.md", + "STAThread": "Advanced\\STAThread.md" }, "How it works": "HowItWorks.md", "Rules of benchmarking": "RulesOfBenchmarking.md",