I have a .net 6 project which uses strawberryshake 12.18.0 grahpql client. It build in my local environment. But when it runs in Azure pipeline it fails to build the project due to below error.

Error SS0006: Method not found: 'Void StrawberryShake.CodeGeneration.CSharp.CSharpGeneratorSettings.set_RequestStrategy(StrawberryShake.Tools.Configuration.RequestStrategy)'

Error CS0246: The type or namespace name 'IGraphQLClient' could not be found (are you missing a using directive or an assembly reference?)

6

There are 6 best solutions below

2
On BEST ANSWER

This probably is due to the use of the analyzer package. When upgrading to version 13 we have rebuild the code generation. You need to remove all strawberry packages and add one of the new packages:

  • StrawberryShake.Server: If you are using StrawberryShake in ASP.NET core or a console.
  • StrawberryShake.Blazor: If you are using StrawberryShake in a Blazor WebAssembly Project
  • StrawberryShake.Maui: If you are using Maui.

Have a look at the docs here that show how to set the client up: https://chillicream.com/docs/strawberryshake/v13/get-started

There is also a YouTube episode linked where I walk you through the new setup.

After the migration the tooling is more robust and work better in the blazor use case.

If you have further issues with this join the community chat: slack.chillicream.com

1
On

Encountered a similar issue: project NET 7, StrawberryShake client 12.18 started to fail build once I updated dotnet SDK to 7.0.305, on 7.0.1 works just fine. Running on mac m1

2
On

+1 on this. Been working perfectly until today - now suddenly it fails in the pipeline but still works on my local machine. I was on 12.16 when I got the error. Tried to update to 12.18 still get the error. Updating to newest (version 13) introduces a lot of errors on my local machine, but in the pipeline it still fails with this exact issue.

After some digging, it seems that the ubuntu image on azure devops have been updated, which causes the error. A (not very good) workaround, is to change the pipeline to use windows instead of ubuntu for the time being.

At least, that solved the issue for me (but my pipeline is an order of magnitude slower). Hope it helps you :)

0
On

I was able to found two solutions so far for this issue.

Solution 01 - Change azure pipeline yaml 'vmImage' property to 'windows-latest'

Solution 02 - Upgrade Strawberryshake client to 13.2.1 version.

  • Remove StrawberryShake.CodeGeneration.CSharp.Analyzers
  • Remove StrawberryShake.Transport.Http
  • Set strawberryshake.tools to version 13.2.1
  • Add StrawberryShake.Server" Version 13.2.1
  • Remove generated folder which generates by the StrawberryShake 12.
  • Run Dotnet clean
  • Build the project
0
On

What worked for me is to add this task to the azure pipeline before the failing task.

  - task: UseDotNet@2
    displayName: 'Use DotNet 6.0 for Project Build'
    inputs:
      version: '6.0.x'

(My app is .Net 6 and StrawberryShake v12.18, just like the OP.)

0
On

Had the same issue using github workflows. The only solution seemed to be to bump Strawberry shake to 13.x, which was pretty simple. Just used the small guide provided here: https://chillicream.com/docs/strawberryshake/v13/migrating/migrate-from-12-to-13