Troubleshooting code scanning
You can see tips to resolve common issues with code scanning.
Note: Code scanning is currently in beta and subject to change. To request access to the beta, join the waitlist.
If an automatic build of code for a compiled language within your project fails, try the following troubleshooting steps.
- Remove the
autobuildaction from your code scanning workflow and specify build steps. For more information, see "Configuring code scanning."
- If the repository for your project contains code in a specific language that does not build, disable automatic language detection in your code scanning workflow and specify only the languages you want to build. For more information, see "Configuring code scanning."
If you scan code written in C# and you need to use .NET Core 2 for a build in Linux, invoke
/p:UseSharedCompilation=false when you build your code in your workflow's
run step. The
UseSharedCompilation flag isn't necessary for .NET Core 3.0 and later.
For example, the following configuration will pass the flag during the first build step.
- run: | dotnet build /p:UseSharedCompilation=false
For more information about specifying build steps, see "Configuring code scanning."