github / github/codeql

CodeQL integration with Visual Studio 2022

Aperta
#15,196 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.