Chisel with multiple Runtime Identifiers
When I install Chisel to my project, I get the following error:
[Chisel.targets(12](http://chisel.targets(12/), 5): ArgumentException: Multiple targets are matching "net8.0" in assets at
/obj/project.assets.json](http://path/to/project/obj/project.assets.json)" (JSON path: targets) (Parameter 'rid') at [Chisel.LockFileExtensions.ReadPackages(LockFile](http://chisel.lockfileextensions.readpackages(lockfile/) lockFile, String tfm, String rid, Predicate`1 filter) in //src/Chisel/LockFileExtensions.cs:line 27 at Chisel.Chisel.ProcessGraph() in //src/Chisel/Chisel.cs:line 178 at Chisel.Chisel.Execute() in /_/src/Chisel/Chisel.cs:line 137
I believe this occurs because this project declares multiple rids:
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
When I remove this, then it builds locally. However, I need to maintain the runtime identifiers because members of my team work on Windows and MacOS and we deploy to Linux. How do I configure Chisel to work with multiple rids?
Unfortunately I can't reproduce your issue. I tried to add <RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers> in the SqlClientSample project and it works fine for me.
Are you using Visual Studio? If yes, what exact version?
Does this issue also occur if you build your project on the command line with the dotnet build command?
Are you using Visual Studio?
I'm using Rider 2024.3.5 (also happened in 2024.3.4)
Does this issue also occur if you build your project on the command line with the
dotnet buildcommand?
Yes.
IDK if this makes a difference, but the <RuntimeIdentifier> I gave earlier is in Directory.Build.props, not a .csproj file. I'm a relative noob to C# and .NET and am just learning about these different project files. This is a large project for the company that I work for, so I can't share code directly from it. And I'm not sure how to create a smaller project that reproduces, either. I can work on figuring that out, though.
And I'm on MacOS Sonoma 14.2.1
And I'm not sure how to create a smaller project that reproduces, either. I can work on figuring that out, though.
That would be the best course of action because I tried to put a Directory.Build.props in the SqlClientSample directory with this content and everything still works as expected.
<Project>
<PropertyGroup>
<RuntimeIdentifiers>linux-x64;osx-x64;win-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>
Also, can you please post the output of dotnet --info please?
$ dotnet --info
https://gitlab.com/vynedental/engineering/payments/web/-/merge_requests/1319
.NET SDK:
Version: 8.0.400
Commit: 36fe6dda56
Workload version: 8.0.400-manifests.b6724b7a
MSBuild version: 17.11.3+0c8610977
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.2
OS Platform: Darwin
RID: osx-x64
Base Path: /usr/local/share/dotnet/sdk/8.0.400/
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.
Host:
Version: 8.0.8
Architecture: x64
Commit: 08338fcaa5
.NET SDKs installed:
3.1.411 [/usr/local/share/dotnet/sdk]
3.1.412 [/usr/local/share/dotnet/sdk]
3.1.426 [/usr/local/share/dotnet/sdk]
5.0.302 [/usr/local/share/dotnet/sdk]
5.0.400 [/usr/local/share/dotnet/sdk]
5.0.408 [/usr/local/share/dotnet/sdk]
6.0.202 [/usr/local/share/dotnet/sdk]
6.0.408 [/usr/local/share/dotnet/sdk]
7.0.102 [/usr/local/share/dotnet/sdk]
7.0.203 [/usr/local/share/dotnet/sdk]
8.0.302 [/usr/local/share/dotnet/sdk]
8.0.400 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.17 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
/path/to/my/project/global.json
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
@0xced Thanks for responding to my original question. I now feel that there is something specific in my project configuration that causes this error when I install Chisel. When I have some more time, I'll look into creating a minimal reproducible example. I can't justify spending any more time on this with my project, at this moment. Thanks again for your time.
You could also produce a binlog file with the -bl option so that I can have a look at your build witout having access to your source code. But make sure that no sensitive information is included by examining the binlog with MSBuild Structured Log Viewer first.
The only way I found to reproduce your issue is to modify the Chisel.targets file and not passing the $(RuntimeIdentifier) to the Chisel task. In other words, there's indeed someting fishy with the runtime identifers.
We can keep this issue open until you find some time to create a minimal reproducible example. There's even a good chance that you'll figure out the solution in the process of creating a reproducible example.