[go: nahoru, domu]

Skip to content
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

CodeQL does not seem to support .NET 6.x (pre-release) #757

Open
manastalukdar opened this issue Oct 3, 2021 · 18 comments
Open

CodeQL does not seem to support .NET 6.x (pre-release) #757

manastalukdar opened this issue Oct 3, 2021 · 18 comments

Comments

@manastalukdar
Copy link

Code is not detected when built with .NET 6.x (pre-release).

@hvitved
Copy link
hvitved commented Oct 4, 2021

Correct, we do not officially support pre-releases for C#.

KexyBiscuit added a commit to QuantSquare/Shimakaze that referenced this issue Oct 29, 2021
@dongle-the-gadget
Copy link

.NET 6 is now officially released.

@Reelix
Copy link
Reelix commented Nov 10, 2021

Similar to #244 (comment)

Add a global.json file to your project with

{
  "sdk": {
    "version": "6.0.100",
    "rollForward": "latestMajor"
  }
}

Tested and working on my .NET 6 project over at https://github.com/Reelix/Reecon

@khaneliman
Copy link

Similar to #244 (comment)

Add a global.json file to your project with

{
  "sdk": {
    "version": "6.0.100",
    "rollForward": "latestMajor"
  }
}

Tested and working on my .NET 6 project over at https://github.com/Reelix/Reecon

Thanks for the workaround. Works for my project, as well.

collinbarrett added a commit to collinbarrett/FilterLists that referenced this issue Nov 11, 2021
collinbarrett added a commit to collinbarrett/FilterLists that referenced this issue Nov 11, 2021
@dongle-the-gadget
Copy link

I added a "Set up .NET" step with .NET version 6 before Autobuild and it also works.

dougwaldron added a commit to gaepdit/enforcement-orders that referenced this issue Nov 15, 2021
CodeQL does not automatically support .NET 6 yet.
github/codeql-action#757
martinussuherman added a commit to martinussuherman/Jokizilla.Models that referenced this issue Nov 17, 2021
Fix for CodeQL not yet support .NET 6, ref: github/codeql-action#757
@Doug-Murphy
Copy link

I added a "Set up .NET" step with .NET version 6 before Autobuild and it also works.

For people who may stumble upon this and not really know what this means, you can add the following to your .yml file as one of the steps in the job. I added this just before the "Initialize CodeQL" step.

    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0'
        include-prerelease: True

@dongle-the-gadget
Copy link
dongle-the-gadget commented Nov 24, 2021

I added a "Set up .NET" step with .NET version 6 before Autobuild and it also works.

For people who may stumble upon this and not really know what this means, you can add the following to your .yml file as one of the steps in the job. I added this just before the "Initialize CodeQL" step.

    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0'
        include-prerelease: True

You don't need to include prerelease if you don't need .NET 6 Preview builds.

@veikkoeeva
Copy link
veikkoeeva commented Nov 24, 2021

To add some information to people coming to this thread, I suppose the official support matrix is at https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/ and it does not include .NET 6 yet.

I checked at https://github.com/lumoin/Verifiable/runs/4308854222?check_suite_focus=true#step:12:92 and got

Error: No code found during the build.

which started after updating to .NET 6 and C# 10. I have not tried add global.json but I take from this thread it would work.

There is setup actions/setup-dotnet@v1 for .NET 6 at https://github.com/lumoin/Verifiable/blob/main/.github/workflows/main.yml#L105.

@dongle-the-gadget
Copy link

To add some information to people coming to this thread, I suppose the official support matrix is at https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/ and it does not include .NET 6 yet.

I checked at https://github.com/lumoin/Verifiable/runs/4308854222?check_suite_focus=true#step:12:92 and got

Error: No code found during the build.

which started after updating to .NET 6 and C# 10. I have not tried add global.json but I take from this thread it would work.

There is setup actions/setup-dotnet@v1 for .NET 6 at https://github.com/lumoin/Verifiable/blob/main/.github/workflows/main.yml#L105.

This might not work if you don't use autobuild.

@veikkoeeva
Copy link

This might not work if you don't use autobuild.

Ah, thanks! This could be a useful piece of information. I have not thought about using autobuild, not even adding global.json but just waiting for the .NET 6 support to appear.

@dongle-the-gadget
Copy link

This might not work if you don't use autobuild.

Ah, thanks! This could be a useful piece of information. I have not thought about using autobuild, not even adding global.json but just waiting for the .NET 6 support to appear.

You could see an example here: https://raw.githubusercontent.com/RanTodd-Team/RanTodd/master/.github/workflows/codeql-analysis.yml

dougwaldron added a commit to gaepdit/complaint-tracking that referenced this issue Dec 8, 2021
CodeQL does not automatically support .NET 6 yet.
github/codeql-action#757
ilike2burnthing added a commit to Jackett/Jackett that referenced this issue Dec 9, 2021
slucky31 added a commit to slucky31/mycomicsmanager that referenced this issue Dec 15, 2021
ahwm added a commit to ahwm/GodaddyWrapper.Net that referenced this issue Jan 4, 2022
disabling CodeQL due to lack of .NET 6 support: github/codeql-action#757 and github/codeql-action#850
@samuel-lucas6
Copy link

Is there any update on this @hvitved? .NET 6 has been out for 2 months now, and since it's an LTS release, support is especially important.

@pmachapman
Copy link

Is there any update on this @hvitved? .NET 6 has been out for 2 months now, and since it's an LTS release, support is especially important.

@samuel-lucas6 Updating global.json and the yml file as described in the comments above has fixed the issue for me for all of my .NET 6.0 projects. Check out pmachapman/GoTo.Bible@9490720 to see this in action.

@samuel-lucas6
Copy link

@samuel-lucas6 Updating global.json and the yml file as described in the comments above has fixed the issue for me for all of my .NET 6.0 projects. Check out pmachapman/GoTo.Bible@9490720 to see this in action.

Thank you for the tip, but I've already had to implement the fix for one of my projects; I'm just trying to bring attention to this issue again since the last message was back in November and .NET 6 should be supported without any tweaks by now.

@hvitved
Copy link
hvitved commented Jan 10, 2022

We updated the C# extractor back in December to use the latest version of Microsoft.CodeAnalysis.CSharp (Roslyn), which means that we will be able to partially support C# 10 code bases (full support is scheduled for implementation this quarter). This means that projects built with C# 10 / .NET 6 should work at least partially.

The workarounds in this thread seem to be about the Actions workers not having .NET 6 installed by default, which appears to still be needed, at least when using ubuntu-latest.

@hvitved
Copy link
hvitved commented Jan 10, 2022

I have added a request for ubuntu-latest to include .NET 6 here: actions/runner-images#4851.

@samuel-lucas6
Copy link

I have added a request for ubuntu-latest to include .NET 6 here: actions/virtual-environments#4851.

Many thanks @hvitved!

marsen added a commit to marsen/Marsen.NetCore.Dojo that referenced this issue Feb 2, 2022
@marsen
Copy link
marsen commented Feb 2, 2022

I was trying to update my .NET Core project to 6.0.
Seems still need workarounds now
It's worked for me but still wonder if need workarounds now?
or already have an official solution?

I added a "Set up .NET" step with .NET version 6 before Autobuild and it also works.

For people who may stumble upon this and not really know what this means, you can add the following to your .yml file as one of the steps in the job. I added this just before the "Initialize CodeQL" step.

    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0'
        include-prerelease: True

mrbeck02 added a commit to mrbeck02/ManagerHelperLocalDb that referenced this issue Sep 20, 2023
Added setup .net step proposed here with .net 7
github/codeql-action#757
zejji added a commit to zejji/DbContextScopeEFCore that referenced this issue Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants