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

Why version must be present in global.json if you don't require it #2756

Closed
xperiandri opened this issue Aug 7, 2023 · 2 comments · Fixed by #2757
Closed

Why version must be present in global.json if you don't require it #2756

xperiandri opened this issue Aug 7, 2023 · 2 comments · Fixed by #2757

Comments

@xperiandri
Copy link
Collaborator

xperiandri commented Aug 7, 2023

Description

When version is absent in global.json call fails at this line

let version = sdk.Property("version").Value.ToString()

Repro steps

  1. Create global.json without version
  2. Execute DotNet.restore id <path>

Expected behavior

No exception happens. More over current exception is not descriptive at all!

Actual behavior

NullReferenceException

Known workarounds

No

Related information

  • FAKE 6.0.0

I'm ready to create a PR if you approve this behavior change

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!

@baronfel
Copy link
Contributor

baronfel commented Aug 7, 2023

Totally agree here - if there's no version this function should return None. Definitely send a PR! (He said, despite not being a maintainer)

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