2

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?)

Adalyat Nazirov
  • 1,611
  • 2
  • 14
  • 28
Hash_Dew
  • 313
  • 1
  • 8

6 Answers6

3

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
Hash_Dew
  • 313
  • 1
  • 8
2

+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 :)

  • 1
    I am encountering this issue starting on June 2 (intermittent) and now every single build. I tried setting different ubuntu versions but it keeps failing. The only solution for me appears to be setting vmImage to windows-latest. Hopefully someone comes up with a better solution, but for now this is the only thing. – Frogger Jun 05 '23 at 23:31
  • Thank you. Changing vmImage to windowsLatest worked for me. But this should be a common issue to strawberryshake users. If you find any better solution keep this thread updated :) – Hash_Dew Jun 06 '23 at 04:26
2

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.)

Frogger
  • 94
  • 8
1

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

0

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

rsl
  • 1
0

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