-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Net5.0 RC2: When building a solution with a target runtime ID an error is given #14281
Comments
Here's the history on why we ended up blocking this: #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? |
解決策不明。issueはあがっていたので、これが解決したらもとに戻す。dotnet/sdk#14281
解決策不明。issueはあがっていたので、これが解決したらもとに戻す。dotnet/sdk#14281
解決策不明。issueはあがっていたので、これが解決したらもとに戻す。dotnet/sdk#14281
Interestingly enough a Both should be possible. |
Similar issue: we are using .NET Core 3.1, the CI fails (since yesterday) with the following debug output:
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. |
fix some issue with dotnet/sdk#14281
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:
The resulting binaries give an error about unable to execute reference assemblies.
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. |
Apparently using a rid as a build target for a solution has been deprecated: dotnet/sdk#14281
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 ***@***.***> 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
<#14281 (comment)>, 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. |
I've 2 workarounds for now:
|
Sorry for the slow reply on this as my notifications were not set up to see the replies here until the mention a couple weeks ago. I've synced with a couple of people offline about this. Per the issue I originally mentioned (#863), when a library is included in a solution and referenced by another project in that solution AND you build the solution with a RID, we end up building the library twice. Once without the RID (as part of the referenced project build) and once with the RID (as part of the root solution build) to the same location. This can cause issues like build failures if there is a timing issue and the file is locked. This can also cause issues if the application has behavior chnages dependent on the RID. The issues that will arise when doing this won't always happen since the primary issue is a race condition. It also won't happen if every project already has RIDs specified in the project. A long-term solution would be to put the IsRidAgnostic logic into the solution handling logic which would avoid the duplicate build. At the moment, it's not high on our priority list to enable that but CCing @KathleenDollard and @richlander in case they have prioritization opinions. One alternative that's relatively cheap would be to just change the error to a warning (with a modified message). Would that work for folks who were utilizing this behavior before? You can then suppress the warning if desired but wouldn't be blocked. |
@marcpopMSFT there are multiple issues, and not all of them are being discussed here, even though they are what is causing part of the issue(s). Publishing projects that only use the core .NET SDK are not handled in the same way as projects that use ASP.NET, due to how the The end goal is for building solutions and projects to work correctly with the If changes are going to made that only delay the inevitable, they should be labeled as such and seriously thought needs to go into, are they helping? Or are they making things worse? Creating new temporary code paths will cause future problems, because that is how we got to where we are now. |
I would really appreciate this! |
@marcpopMSFT Just ran into this one where I want to build + run a debug server on WSL. CLI parameters should just override the configs and warn people if both are specified. I prefer not changing code I have to remember to change back. |
I would also really appreciate just temporarily, until a more long term solution is put in place to actually solve the other issue which caused this to be blocked, swap this into a warning that could be suppressed instead. @marcpopMSFT |
We did recently add IsRidAgnostic but unfortunately, we were not able to enable it for solution files. We found that it was either going to greatly impact performance for solutions but essentially doing multiple builds or require a significant amount of logic. Daniel's workaround here is still the only solution at the moment: #14281 (comment) We'll take another look at our options in 8.0.1xx |
(from comment) as for sdk 6.0.402 |
How can we tie that up with multiplatform (arm64 + x86) buildx dockerfile? They inject amd64 and arm64 as variables. Linux I could hardcode. |
@turowicz From what I can tell, it looks like buildx passes the platform as
<Project>
<PropertyGroup Condition="'$(TargetArch)' == 'x86'">
<RuntimeIdentifier>linux-x86</RuntimeIdentifier>
</PropertyGroup>
<!-- Note! Docker buildx uses amd64 instead of x64! -->
<PropertyGroup Condition="'$(TargetArch)' == 'amd64'">
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetArch)' == 'arm64'">
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
</PropertyGroup>
</Project> |
@marcpopMSFT , same error in .NET 8 (8.0.100) |
@kabili207 looks pretty good |
This seems like the most pointless limitation ever that still hasn't been fixed. |
I am still waiting for a fix to this. I have been unable to set up cross platform compilations on my jenkins server since this change. I know the fix was planned for Net 8, but seeing as it has yet to be fixed @marcpopMSFT, what is the new ETA on a fix? Workarounds are great and all, but are not so simple to set up. |
I've encountered the same problem and found a solution that works in .NET8 (so give it a try and see if it works in other cases): You need to add a file named Directory.Build.props to the root of your solution folder, containing this:
You can replace the |
Retriage The recommendation is still to do the solution outlined by @dsplaisted here: #14281 (comment) That should work and be relatively inexpensive to implement. |
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:If this is the new normal, is there a replacement method for cross-compiling an entire solution for multiple platforms?
The text was updated successfully, but these errors were encountered: