You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case I have two separate jobs according to matrix. 3.1 successfully completed, but 2.1 is failed on build step with error like this:
[error]/opt/hostedtoolcache/dncs/2.1.806/x64/sdk/2.1.806/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5):
error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1.
Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [<path to Test.csproj>]
I am a bit stuck how to do it properly? Could you give me some advice?
Actually I have found two workarounds here:
Described in the issue Support installing multiple versions of .NET Core SxS #25 . Do not use matrix and setup both dotnet versions in the one job and use rsync to setup and side by side. The problem here is that your steps becomes sequential instead of parallel steps which would be in matrix testing. Also the job's code becomes more complicated.
Use conditions in csproj. We could describe target frameworks like this:
Library csproj:
My understanding is that a library targeted as netstandard2.0 will generally be portable to use with netcoreapp3.1. You should be able to specify just netstandard2.0 in the library and testing could work against both versions. This talks more about multi-target libraries and the cases where this might not work: https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting
The dotnet team would be the best place to get help with the framework and targetting issues, feel free to reach out to them if you need further advice: https://github.com/dotnet/runtime#filing-issues
Let me explain the problem. I have a library and tests for it in two separate projects.
Library csproj:
Tests csproj:
I want to run tests in both LTS versions of netcoreapp 2.1 and 3.1. In case of 2.1 the library should be build as netstandard2.0.
Here is my workflow job:
In this case I have two separate jobs according to matrix. 3.1 successfully completed, but 2.1 is failed on build step with error like this:
I am a bit stuck how to do it properly? Could you give me some advice?
Actually I have found two workarounds here:
rsync
to setup and side by side. The problem here is that your steps becomes sequential instead of parallel steps which would be in matrix testing. Also the job's code becomes more complicated.Library csproj:
Tests csproj:
and custom parameter will be added to the dotnet test command:
In this case CI problem affects the entire code base (csproj) which is bad idea I think.
So I am still trying to find better solution.
The text was updated successfully, but these errors were encountered: