-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CSharp] Error: No code found during the build. #851
Comments
Hi, please add |
Thanks @criemen :-) for Good work you guys are doing. |
Hi @criemen, |
same here, I tried CodeQL CLI on Azure pipelines and the project is built with VS 2022 and the error is "No code found during the build". I do have /p:UseSharedCompilation=false in my build commands. Any suggestions? |
For Azure Pipelines, could you please try following the example at https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/#example-of-creating-a-codeql-database-using-indirect-build-tracing and let us know if that doesn't work? Azure Pipelines has its own method of setting environment variables for future build steps, which is required to ensure that the CodeQL build instrumentation persists in the environment. |
Thanks for replying soon. I am adding CodeQl ( Semmle) ( CSharp) tool to the Azure pipeline tasks which covers all the steps mentioned in your example but it uses CodeQL database trace-command and not indirect build tracing. Is there any tool that I can add to the pipeline tasks that does indirect tracing? |
Please try using indirect build tracing first; direct use of |
@criemen was something already done by codeql to auto-inject This is probably a new issue, but I noticed that initializing the CodeQL call before our build steps disrupted our |
@michael-hawker Yes, CodeQL automatically injects those flags into specific I am aware of one more issue we are investigating about quoted parameters containing spaces -- if you can share more about that specific problem you are seeing (including the exact command line for your |
@adityasharad thank's for the info! This is effectively what we're seeing below (it's a bit complicated as we construct our call to the tool from a PowerShell script which is where I was looking for the problem initially). Here's the effective command running with CodeQL:
And without:
And the relevant bits to compare:
We were seeing the quotes around our platform parameter being stripped out and thus causing our tool to fail due to the space for |
Thanks to jborean from the PowerShell Discord community Had tried escaping quotes for PowerShell passing in CodeQL build, but was issue with CodeQL itself, see github/codeql-action#851 (comment) Related PowerShell Info: https://stackoverflow.com/questions/6714165/powershell-stripping-double-quotes-from-command-line-arguments https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3#passing-arguments-that-contain-quote-characters
Thanks to jborean from the PowerShell Discord community Had tried escaping quotes for PowerShell passing in CodeQL build, but was issue with CodeQL itself, see github/codeql-action#851 (comment) Related PowerShell Info: https://stackoverflow.com/questions/6714165/powershell-stripping-double-quotes-from-command-line-arguments https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3#passing-arguments-that-contain-quote-characters
Thanks to jborean from the PowerShell Discord community Had tried escaping quotes for PowerShell passing in CodeQL build, but was issue with CodeQL itself, see github/codeql-action#851 (comment) Related PowerShell Info: https://stackoverflow.com/questions/6714165/powershell-stripping-double-quotes-from-command-line-arguments https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3#passing-arguments-that-contain-quote-characters
https://github.com/Dheerajcode2016/opentelemetry-elk-exporter/runs/4497062547?check_suite_focus=true
It looks like the action fails to automatically detect source code for CSharp .NET 6.0
The error returned is coming back from the Codeql CLI and the information isn't that useful in the context of the GitHub action.
Context:
My project is built with Visual Studio 2022 and has CSharp files
The text was updated successfully, but these errors were encountered: