microsoft / microsoft/aspire

Aspire.Hosting.Sdk, Sdk.targets does not accept version pinning

Open
#8,242 1 comment 0 reactions 0 assignees View on GitHub
area-acquisition
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

If I pin the Aspire NuGet version I get following error on compilation of my project:

Severity Code Description Project File Line Suppression State
Error (active) MSB4184 The expression "[MSBuild]::VersionLessThan([8.2.2,9.0), 8.2.0)" cannot be evaluated. Version string was not in a correct format. Test.AppHost C:\Program Files\dotnet\packs\Aspire.Hosting.Sdk\8.2.2\Sdk\Sdk.targets 80

Sdk.targets contains a rule, which block the attempt to pin the package version:


<_AppHostVersion>8.2.2

### Expected Behavior

It is possible to pin aspire NuGet packages

### Steps To Reproduce

1. Create a solution to be used with Aspire target version net core 8. or use my example in https://github.com/IoBes/Aspire_Sdk.targets_Bug
2. Create Directory.Packages.props and enable `true`
3. try to pin version for example: ``
4. try to compile the project
5. Note a bug: Severity Code Description Project File Line Suppression State
Error (active) MSB4184 The expression "[MSBuild]::VersionLessThan([8.2.2,9.0), 8.2.0)" cannot be evaluated. Version string was not in a correct format. Test.AppHost C:\Program Files\dotnet\packs\Aspire.Hosting.Sdk\8.2.2\Sdk\Sdk.targets 80

There is a rule, which block the attempt to pin the package version:
```


<_AppHostVersion>8.2.2

```

### Exceptions (if any)

Error (active) MSB4184 The expression "[MSBuild]::VersionLessThan([8.2.2,9.0), 8.2.0)" cannot be evaluated. Version string was not in a correct format. Test.AppHost C:\Program Files\dotnet\packs\Aspire.Hosting.Sdk\8.2.2\Sdk\Sdk.targets

### .NET Version info

dotnet 8.

### Anything else?

ASP.NET Core version: 8.0
.NET Aspire version: 8.2.2
The IDE: VS 2022, Version 17.13.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.