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.26k stars 746 forks source link

Bug in StrawberryShake.Server v13.1.0 - The expression "[MSBuild]::VersionGreaterThanOrEquals('', 7)" cannot be evaluated. Version string was not in a correct format. #6224

Closed thomastvedt closed 1 year ago

thomastvedt commented 1 year ago

Is there an existing issue for this?

Product

Strawberry Shake

Describe the bug

When upgrading StrawberryShake.Server from v13.0.5 to v13.1.0 I get a compilation error:

StrawberryShake.Server.targets(38, 20): [MSB4184] The expression "[MSBuild]::VersionGreaterThanOrEquals('', 7)" cannot be evaluated. Version string was not in a correct format.

image

It helps to run dotnet graphql update, but this shouldn't be necessary. Other users checking out the repo should not have to run any tool commands.

Found this related slack chat: https://hotchocolategraphql.slack.com/archives/CMUJ40EHJ/p1685372432603619

Steps to reproduce

  1. Setup a project with StrawberryShake.Server v13.0.5
  2. Upgrade to v13.1.0
  3. Build project

Relevant log output


       "/Users/username/projects/Edge/yClient/Company.MyClient.csproj" (rebuild target) (1) ->
       (GenerateGraphQLCode target) -> 
         MSBUILD : warning MSB5029: The value "\**\*.cs" of the "Include" attribute in element <ItemGroup> in file "/Users/username/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets (23,16)" is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined.

       "/Users/username/projects/Edge/yClient/Company.MyClient.csproj" (rebuild target) (1) ->
       (_GenerateGraphQLCode target) -> 
         /Users/username/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals('', 7)" cannot be evaluated. Version string was not in a correct format.

       "/Users/username/projects/Edge/yClient/Company.MyClient.csproj" (rebuild target) (1) ->
       (CoreCompile target) -> 
         CSC : error CS2021: File name '/**/*.cs' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long
         CSC : error CS2001: Source file '/**/*.cs' could not be found.

Additional Context?

.graphqlrc.json:

{
  "schema": "schema.graphql",
  "documents": "**/*.graphql",
  "extensions": {
    "strawberryShake": {
      "name": "MyClient",
      "url": "https://localhost:5001/graphql/",
      "dependencyInjection": true,
      "strictSchemaValidation": true,
      "hashAlgorithm": "md5",
      "noStore": true,
      "emitGeneratedCode": false,
      "razorComponents": false,
      "records": {
        "inputs": false,
        "entities": false
      },
      "transportProfiles": [
        {
          "default": "Http",
          "subscription": "WebSocket"
        }
      ]
    }
  }
}

project.csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
        <TargetFramework>net7.0</TargetFramework>
        <Nullable>enable</Nullable>
        <OutputType>Library</OutputType>
        <Authors>Company</Authors>
        <Company>Company</Company>
        <LangVersion>11</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
    <PackageReference Include="StrawberryShake.Server" Version="13.1.0" />
    <PackageReference Include="System.Reactive" Version="6.0.0" />
    <PackageReference Include="System.Reactive.Linq" Version="6.0.0" />

  </ItemGroup>

  <ItemGroup>
      <GraphQL Update="GraphQL\MyQuery.graphql">
        <Generator>MSBuild:Compile</Generator>
      </GraphQL>
    </ItemGroup>

</Project>

Version

StrawberryShake.Server: 13.1.0
dotnet --version => 7.0.100

thomastvedt commented 1 year ago

Ahh.. duplicate: https://github.com/ChilliCream/graphql-platform/issues/6180 https://github.com/ChilliCream/graphql-platform/issues/6048