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

[Info] dotnet ^7.0.2* introduced an MSBuild preview version with breaking changes. #383

Closed
2 of 5 tasks
snwflake opened this issue Feb 18, 2023 · 11 comments
Closed
2 of 5 tasks
Labels
external Unexpected behavior was caused by external problems

Comments

@snwflake
Copy link

snwflake commented Feb 18, 2023

Description:
For reference: dotnet/sdk#30624

The MSBuild preview version provided with 7.0.200 introduced breaking changes and generally ill-formed behavior.

Pinning the version to anything below 7.0.200, ie. 7.0.103 does not resolve that issue, as the same MSBuild preview is still being used.

My workaround so far has been to add another step after the dotnet-setup which just removes 7.0.2* sdk versions. Only then started my build to produce working output with proper viewcomponents.

Task version:
926f442

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

- name: Setup .net
  uses: actions/setup-dotnet@v3
  with:
    dotnet-version: 7.0.103
dotnet publish app -c Release -o ~/deploy
MSBuild version 17.5.0-preview-23061-01+040e2a90e for .NET

Notes:
While this is a bug introduced by the SDK, I still wanted to raise this issue here, to spare others from wasting 3 hours debugging it.
The workaround for me is currently the following until the announced hotfix 7.0.201 goes live:

- name: Setup .net
  uses: actions/setup-dotnet@v3
  with:
    dotnet-version: 7.0.103
- name: Remove faulty SDK version
  run: sudo rm -rf /usr/share/dotnet/sdk/7.0.2*
@panticmilos
Copy link
Contributor

hi @snwflake, thank you for the report, we will take a look at it :)

@danielriddellsh
Copy link

Typo in your fix, should be -rf otherwise it errors with:
rm: cannot remove '/usr/share/dotnet/sdk/7.0.200': Is a directory

@snwflake
Copy link
Author

@danielriddellsh sorry, should have copy&pasted.

@Shane32
Copy link

Shane32 commented Feb 25, 2023

7.0.201 has been released but it’s not picked up by setup-dotnet. Anyone know what’s up?

@edumserrano
Copy link

I just wanted to leave here that one of the workarounds described here worked for me.

What I did was make use of a global.json file to pin the version of dotnet to 7.0.103. I also had to make sure that my dotnet CLI commands were picking up the global.json file. See the note below.

This fixed the issue for me without having to remove the default installation of dotnet SDK 7.0.200 from the GitHub runner. I just need to make sure that the actions/setup-dotnet@v3 installs a previous working version such as 7.0.103. You can review here an example of the PRs I've made on my repos to fix this issue: edumserrano/github-issue-forms-parser#28.

Note

As per the global.json overview docs:
"The .NET SDK looks for a global.json file in the current working directory (which isn't necessarily the same as the project directory) or one of its parent directories."

This means that you need to be careful regarding what the working directory where you run the dotnet CLI commands is to make sure the global.json file is respected.

@stunney
Copy link

stunney commented Feb 28, 2023

6.0.* also has breaking issues with dotnet pack --output as well. This is due to a preview version of MSBuild being tacked onto the setup-dotnet GHA that I don't think was intended.

dotnet/core#8245

@AZ-X
Copy link

AZ-X commented Mar 21, 2023

It's a terrible release, isn't it?
I gotter face strange NETSDK1168 unexpectedly...

@tgrnwd
Copy link

tgrnwd commented Apr 12, 2023

My experience seems to be that running any dotnet command in conjunction with v3 of this action is using the latest SDK, even though I specify 6.0.x in the setup-dotnet action.

Falling back to v2 of this action produces the expected behavior.

@IvanZosimov
Copy link
Contributor

Hi, @tgrnwd 👋 The v3 release contains some breaking changes and it's behaviour is different from v2 version. Please, refer to this part of documentation to get additional information https://github.com/actions/setup-dotnet#usage.

@tgrnwd
Copy link

tgrnwd commented Apr 13, 2023

@IvanZosimov Ah, thank you. I'm certain I read this, but didn't fully understand at that time.

@IvanZosimov IvanZosimov added external Unexpected behavior was caused by external problems and removed bug Something isn't working labels Jul 7, 2023
@IvanZosimov
Copy link
Contributor

I'm closing this issue as the NET SDK 7.0.201 was released and it seems to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Unexpected behavior was caused by external problems
Projects
None yet
Development

No branches or pull requests

9 participants