From 8d607e6251879115d41eae1ba340a2402b243d2d Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 14 Dec 2021 10:40:07 +0100 Subject: [PATCH] Docs: Add paragraph about C# shared compilation --- docs/codeql/codeql-cli/creating-codeql-databases.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/codeql/codeql-cli/creating-codeql-databases.rst b/docs/codeql/codeql-cli/creating-codeql-databases.rst index c236ae1d4e2..a98b75da621 100644 --- a/docs/codeql/codeql-cli/creating-codeql-databases.rst +++ b/docs/codeql/codeql-cli/creating-codeql-databases.rst @@ -210,6 +210,10 @@ commands that you can specify for compiled languages. - C# project built using ``dotnet build``:: + For C# projects using either `dotnet build` or `msbuild`, you should specify `/p:UseSharedCompilation=false` + in the build command. It is also a good idea to add `/t:rebuild` to ensure that all code will be built (code + that is not built will not be included in the CodeQL database): + codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild' - Go project built using the ``COEQL_EXTRACTOR_GO_BUILD_TRACING=on`` environment variable::