Search code examples
c#.netgraphqlstrawberry-graphqlstrawberryshake

C# .Net build failure due to strawberryshake error - Method not found: 'Void StrawberryShake.CodeGeneration.CSharp.CSharpGeneratorSettings


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


Solution

  • 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