ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.19k stars 739 forks source link

"The Strawberry Shake code generation requires .NET SDK 6 or .NET SDK 7 to work" error when using preview version of .NET #5823

Closed Mephistofeles closed 9 months ago

Mephistofeles commented 1 year ago

Is there an existing issue for this?

Product

Strawberry Shake

Describe the bug

There is a bug in StrawberryShake.Server.targets resulting in incorrect error "The Strawberry Shake code generation requires .NET SDK 6 or .NET SDK 7 to work." when using preview version of .NET, for example dotnet version returning: 7.0.200-preview.22628.1 It can't be parsed by Version.TryParse and DotNetMajor does not return correct major version.

Steps to reproduce

  1. Install preview version of .NET 6 or 7
  2. Try to build project using StrawberryShake.Server
  3. Build results in error : The Strawberry Shake code generation requires .NET SDK 6 or .NET SDK 7 to work.

Relevant log output

No response

Additional Context?

No response

Version

13.0.2

sunghwan2789 commented 1 year ago

For reference, 13.0.0-rc.4 works even if I use the preview version of .NET SDK.

michaelstaib commented 1 year ago

RC4 was pinned to SDK 6. If you had non installed it would not work.

I will put this on the next patch build.

Thanks for reporting this.

sunghwan2789 commented 1 year ago

I think this can be handled with https://learn.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2022#msbuild-version-comparison-functions

glen-84 commented 9 months ago

Closing. This was likely fixed by #6012.