How to achieve package reference with wildcard version by using install-package in visual studio 2017? Example line :
PackageReference Include="somePackage" Version="*"
When I try
Install-Package somePackage -Version *
I get error:
Install-Package : Failed to parse the input of Version parameter: * to a valid Semantic version.
Unfortunately install-package command does not support a wild card version. But if you have a .NET Core based project then you can use the dotnet.exe add package package_name --version * command from the developer command prompt.
How to check if your project is .NET Core based -
Edit project_name.csprojIf your project is .NET Core based -
dotnet add package package_name --version *Please note that having a * in a package reference is potentially dangerous as it will always get you the latest version which can bring in breaking changes.
dotnet add package does not support neither pre-releases nor wildcards, see open issues:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With