In previous versions of dotnet core, you could build a solution with the runtime flag -r
and it would build for that target (ex. dotnet build -c Release -r win-x64
. Now however with RC2 it appears to echo out the error:
error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead.
If this is the new normal, is there a replacement method for cross-compiling an entire solution for multiple platforms?
Here's the history on why we ended up blocking this: https://github.com/dotnet/sdk/issues/863
Agree, the same issue with release build of .net 5
So how do we compile for e.g. both win10-x64 and linux-x64 in the same build process?
Same question here. I need to compile a Solution for both Windows and Linux. How would I do that?
Interestingly enough a
dotnet test MySolution.sln -c Release -r win-x64
works fine without any error. It also builds the whole solution with the specified runtime before executing all unit tests. How is that different from
dotnet build MySolution.sln -c Release -r win-x64
??? :confused:
Both should be possible.
Similar issue: we are using .NET Core 3.1, the CI fails (since yesterday) with the following debug output:
[debug]Processed: ##vso[task.logdetail id=0b1a9c29-b168-43d6-a78f-b4b2faadcb38;parentid=;name=Microsoft.NET.Sdk.Solution.targets;type=Build;starttime=2020-11-20T14:52:05.6730082Z;state=InProgress;]
[error]C:\Program Files\dotnet\sdk\5.0.100\Current\SolutionFile\ImportAfter\Microsoft.NET.Sdk.Solution.targets(27,5): Error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead.
We are using Azure pipelines with hosted agents.
Same. .NET Core 3.1 on Azure DevOps Server (self-hosted) is getting this when attempting to use the 5.0.100 SDK.
Same, CI has just failed after updating to sdk 5.0.. Bit annoying to have to specify each project individually!
When building against the 5.0 release version on my CI server using the command:
dotnet publish -c release -r win-x64 -o bin
The resulting binaries give an error about unable to execute reference assemblies.
C:\Users\User\Desktop\New folder>wait.exe
Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'C:\Users\User\Desktop\New folder\wait.dll'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)
File name: 'C:\Users\Wait\Desktop\New folder\wait.dll' ---> System.BadImageFormatException: Cannot load a reference assembly for execution.
When running the compilation process on a windows machine, the resulting binaries do not give off this same error and instead execute as you would expect them to. The CI server's operating system is Linux, so had to manually re-compile on a windows machine.
I would love to have this back too. We pass in the desired architecture in our CI pipeline and build scripts because we have both windows and Linux machines.
so how can we build solution for particular RID now? If I do not specify RID - it builds for default RID, and then publishing for specific RID fails. All I can do now is to build each single project one by one with RID specified - which sucks tbh
It’s especially bad for complex solutions where individual projects depend
on other projects, because these dependencies are defined in the solution
so you need to manually configure the build to ensure each project is built
in order
-Will
On Wed, Dec 23, 2020 at 6:24 AM Dennis notifications@github.com wrote:
so how can we build solution now for particular RID now? If I do not
specify RID - it builds for default RID, and then publishing for specific
RID fails. All I can do now is to build each single project one by one with
RID specified - which sucks tbh—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/sdk/issues/14281#issuecomment-750322316, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ACJUAUQFSUFWPXPSZLTXPTDSWH4SHANCNFSM4S3JMCUQ
.
Well, this is unexpected. I've an AzD pipeline template that is used to build dozens of similar projects and it relies on the solution level actions + rid. E.g. (extra simplified):
dotnet restore -r RID
dotnet build -r RID
dotnet publish -r RID
The RID is passed via CI. The resulting artifacts are used to build docker images for different OS (glibc/musl based) in the subsequent pipeline steps.
Most helpful comment
Interestingly enough a
dotnet test MySolution.sln -c Release -r win-x64
works fine without any error. It also builds the whole solution with the specified runtime before executing all unit tests. How is that different from
dotnet build MySolution.sln -c Release -r win-x64
??? :confused:Both should be possible.