Skip to content

Commit 8d607e6

Browse files
committed
Docs: Add paragraph about C# shared compilation
1 parent 6f65f22 commit 8d607e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/codeql/codeql-cli/creating-codeql-databases.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ commands that you can specify for compiled languages.
210210

211211
- C# project built using ``dotnet build``::
212212

213+
For C# projects using either `dotnet build` or `msbuild`, you should specify `/p:UseSharedCompilation=false`
214+
in the build command. It is also a good idea to add `/t:rebuild` to ensure that all code will be built (code
215+
that is not built will not be included in the CodeQL database):
216+
213217
codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild'
214218

215219
- Go project built using the ``COEQL_EXTRACTOR_GO_BUILD_TRACING=on`` environment variable::

0 commit comments

Comments
 (0)