Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSharpier.MsBuild still targets .NETCoreApp,Version=v5.0 (somehow) #565

Closed
shocklateboy92 opened this issue Jan 23, 2022 · 2 comments · Fixed by #591
Closed

CSharpier.MsBuild still targets .NETCoreApp,Version=v5.0 (somehow) #565

shocklateboy92 opened this issue Jan 23, 2022 · 2 comments · Fixed by #591
Milestone

Comments

@shocklateboy92
Copy link
Collaborator

My guess is this line:

<CSharpierOutputDir>../CSharpier.Cli/bin/$(Configuration)/net5.0</CSharpierOutputDir>

It causes an old version of csharpier cli that happens to be sitting around on the build machine to be bundled with the MsBuild nuget package. Causing this when someone tries to use it on a machine that only has .net6 installed:

Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  Erabikata.Models -> /tmp/scratch/erab/backend/Erabikata.Models/bin/Debug/netstandard2.1/Erabikata.Models.dll
  Erabikata.Backend -> /tmp/scratch/erab/backend/Erabikata.Backend/bin/Debug/net6.0/Erabikata.Backend.dll
  It was not possible to find any compatible framework version
  The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
    - The following frameworks were found:
        6.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  
  You can resolve the problem by installing the specified framework and/or SDK.
  
  The specified framework can be found at:
    - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=arch-x64
/home/fernie/.nuget/packages/csharpier.msbuild/0.14.0/build/CSharpier.MsBuild.targets(11,9): error MSB3073: The command "dotnet /home/fernie/.nuget/packages/csharpier.msbuild/0.14.0/build/../tools/csharpier/dotnet-csharpier.dll  /tmp/scratch/erab/backend/Erabikata.Backend" exited with code 150. [/tmp/scratch/erab/backend/Erabikata.Backend/Erabikata.Backend.csproj]

Build FAILED.

/home/fernie/.nuget/packages/csharpier.msbuild/0.14.0/build/CSharpier.MsBuild.targets(11,9): error MSB3073: The command "dotnet /home/fernie/.nuget/packages/csharpier.msbuild/0.14.0/build/../tools/csharpier/dotnet-csharpier.dll  /tmp/scratch/erab/backend/Erabikata.Backend" exited with code 150. [/tmp/scratch/erab/backend/Erabikata.Backend/Erabikata.Backend.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.00
@belav
Copy link
Owner

belav commented Jan 23, 2022

Duplicate of #483 but this has more info.
Should the MSBuild version only support .net6? The other option is to figure out if it is possible to get it working with both .net5 and .net6.

@shocklateboy92
Copy link
Collaborator Author

Let's only support dotnet 6. I don't think 5 is an LTS version, so there's no reason anyone would have only 5 installed.

@belav belav added this to the 0.15.0 milestone Feb 5, 2022
@belav belav mentioned this issue Feb 6, 2022
7 tasks
belav added a commit that referenced this issue Feb 6, 2022
shocklateboy92 pushed a commit that referenced this issue Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants