github / github/codeql

CodeQL integration with Visual Studio 2022

Offen
#15,196 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

Hello all,

I was trying to run Codeql from Visual studio2022, steps given below.

1-downloaded codeql-bundle-win64 from git >> set Path for Codeql
2-Open My sample C# application
3- Created Batch file with "codeql database create D:\csharp-database1057 --language=csharp --overwrite"
4- set as Prebuild event
5- Created Batch file with "codeql database analyze D:\csharp-database1057 csharp-code-scanning.qls --sarif-category=javascript-typescript --format=sarif-latest --output=C:\Output\xyz.sarif"
6- Build the solution

o/p: exception from step3
2023-12-22 18:29:48] Exception caught at top level: D:\csharp-database1057 is not a recognized CodeQL database.
com.semmle.cli2.database.DatabaseLayout.(DatabaseLayout.java:189)
com.semmle.cli2.database.DatabaseLayout.load(DatabaseLayout.java:136)
com.semmle.cli2.database.DatabaseLayout.loadAndSetupLogging(DatabaseLayout.java:237)
com.semmle.cli2.database.MultiDatabaseOptions.resolveDatabases(MultiDatabaseOptions.java:68)
com.semmle.cli2.database.MultiDatabaseOptions.resolveDatabases(MultiDatabaseOptions.java:60)
com.semmle.cli2.database.FinalizeCommand.executeSubcommand(FinalizeCommand.java:120)
com.semmle.cli2.picocli.SubcommandCommon.lambda$executeSubcommandWithMessages$5(SubcommandCommon.java:803)
com.semmle.cli2.picocli.SubcommandCommon.withCompilationMessages(SubcommandCommon.java:442)
com.semmle.cli2.picocli.SubcommandCommon.executeSubcommandWithMessages(SubcommandCommon.java:801)
com.semmle.cli2.picocli.PlumbingRunner.run(PlumbingRunner.java:119)
com.semmle.cli2.picocli.SubcommandCommon.runPlumbingInProcess(SubcommandCommon.java:199)
com.semmle.cli2.database.CreateCommand.executeSubcommand(CreateCommand.java:199)
com.semmle.cli2.picocli.SubcommandCommon.lambda$executeSubcommandWithMessages$5(SubcommandCommon.java:803)
com.semmle.cli2.picocli.SubcommandCommon.withCompilationMessages(SubcommandCommon.java:442)
com.semmle.cli2.picocli.SubcommandCommon.executeSubcommandWithMessages(SubcommandCommon.java:801)
com.semmle.cli2.picocli.SubcommandCommon.toplevelMain(SubcommandCommon.java:685)
com.semmle.cli2.picocli.SubcommandCommon.call(SubcommandCommon.java:666)
com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:237)
com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:247)
com.semmle.cli2.CodeQL.main(CodeQL.java:115)

Can someone provide suggestion how I can go about this CodeQL integration with Vs2022? Any suggestions will be greatly appreciated.

It is working fine with individual command execution from Command Prompt for Database Creation /database analyze.

Thanks,
Avdhesh

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.