NuGet Invalid Version String - on Linux when os-versions includes a space in the version
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
@shyzus commented on [Tue, 01 Sep 2020 01:47:50 GMT](https://github.com/NuGet/Home/issues/9972)
# Details about Problem
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet
NuGet version (x.x.x.xxx): 5.4.0.2
dotnet.exe --version (if appropriate): 3.1.106
VS version (if appropriate): N/A
OS version (i.e. win10 v1607 (14393.321)): Fedora 32.20200831.0 (Silverblue)
Worked before? If so, with which NuGet version: N/A
## Detailed repro steps so we can see the same problem
1. Create toolbox in silverblue with:
`toolbox create --container dotnet-toolbox`
2. Enter toolbox:
`toolbox enter dotnet-toolbox`
3. Install required packages:
`sudo dnf install dotnet-sdk-3.1 dotnet-host dotnet dotnet-templates-3.1 dotnet-targeting-pack-3.1 dotnet-apphost-pack-3.1 dotnet-build-reference-packages mono-devel`
4. Create a new Command Line Application
`mkdir MyConsoleApp`
`cd MyConsoleApp`
`dotnet new console`
5. Attempt to build
`dotnet build`
## Other suggested things
This can be solved with a hotfix for other Silverblue users by modifying their /etc/os-release file and removing any whitespaces and any parenthesis e.g "()".
However I would suggest whatever code is determining whether a version is valid or invalid is updated to permit whitespaces and/or parenthesis. I am not aware of any issues this change would cause and would like to see this change implemented.
### Logs
> Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
>
>/usr/lib64/dotnet/sdk/3.1.106/NuGet.targets(123,5): error : '32 (Container Image)' is not a valid version string. (Parameter 'value') [/var/home/falcon/RiderProjects/consoleapp/consoleapp.csproj]
>
>Build FAILED.
>
>/usr/lib64/dotnet/sdk/3.1.106/NuGet.targets(123,5): error : '32 (Container Image)' is not a valid version string. (Parameter 'value') [/var/home/falcon/RiderProjects/consoleapp/consoleapp.csproj]
0 Warning(s)
1 Error(s)
>
>Time Elapsed 00:00:00.46
### Sample Project
See step 3.
_Edited: Added missing step_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.