Open egil opened 2 years ago
Nice feature. Did not know this is around. A few things we have to consider:
Directory.Build.props
and have the same effect with less clutter in the csproj. The rosyln compiler will remove anyway every assembly which is not used in the code anyway (via static analysis).But I'd like to keep this open to see where this is going in the future. Cool thing you found there Egil ;)
If it doesnt work with Rider/the command line, then yeah, lets wait a bit with this.
Just to have some documentation about our findings: This might be something for version 2.0. Currently the support of < .net6 will block that feature.
Let's assume we want to build .net5 assembly. We can do this with everything equal or higher than the .net5 SDK, but unfortunately that does not work with running tests. The test-runner has to come from the same SDK version as the assembly under test.
That means we can't simplify our CI/CD pipeline to use the following:
- name: ⚙️ Setup dotnet versions
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
6.0.x # Only latest stable release - can build everything <= net6.0 but not test != net6.0
7.0.x # Only latest preview release - can build everything <= net7.0 but not test != net7.0
include-prerelease: true
Another issue we might run into is dependabot as I am not sure whether or not they support that feature.
NuGet had a juicy update: https://devblogs.microsoft.com/nuget/announcing-nuget-6-4-signed-central-delivered/#use-a-single-packagereference-everywhere-with-globalpackagereference
Still something for v2
.
Conclusion: We can go ahead with this feature as tooling support is given.
CPM looks like an opportinuty to clean up our .csproj and directory.build.props files, at least to some extend. https://docs.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management