✅ Dependency restores to incorrect package
I have a dotnet solution called
A.sln
which depends on another solution B.sln
.
Both A.sln
and B.sln
have some child projects which has some const value differences depending on the platform:
* A.Win64.csproj
, A.Win32.csproj
, A.Posix64.csproj
, A.Posix32.csproj
* B.Win64.csproj
, B.Win32.csproj
, B.Posix64.csproj
, B.Posix32.csproj
For each of A
's sub projects, it should depend on the right version of the B
's subproject:
* A.Win64.csproj
-> B.Win64.csproj
* A.Win32.csproj
-> B.Win32.csproj
* A.Posix64.csproj
-> B.Posix64.csproj
* A.Posix32.csproj
-> B.Posix32.csproj
But if I build the A.sln
with dotnet build
, the dependency is restored to only one version of B
's subproject, for example:
* A.Win64.csproj
-> B.Posix64.csproj
* A.Win32.csproj
-> B.Posix64.csproj
* A.Posix64.csproj
-> B.Posix64.csproj
* A.Posix32.csproj
-> B.Posix64.csproj
To avoid this issue, I had to manually iterate through all the sub projects like
dotnet build A.Win64.csproj
, dotnet build A.Win32.csproj
, dotnet build A.Posix64.csproj
, dotnet build A.Posix32.csproj
.
Is there any settings I can tweak to avoid this pitfall?
Or should I file an issue about this?27 Replies
Unknown User•4d ago
Message Not Public
Sign In & Join Server To View
Actually, they are already on the GitHub:
B : https://github.com/nalchi-net/GnsSharp
A : https://github.com/nalchi-net/NalchiSharp
A depends on the B via
PackageReference
to each nuget packageUnknown User•4d ago
Message Not Public
Sign In & Join Server To View
Yeah
Unknown User•4d ago
Message Not Public
Sign In & Join Server To View
I update NalchiSharp once the GnsSharp is public on nuget.org
Let me clear the cache
and restore
NalchiSharp.sln
...
Still, only the Posix64 is restored this way?
Yep, after dotnet build NalchiSharp.sln
, all the *.deps.json
points to the same sub project: GnsSharp.Gns.Win32.dll
Maybe I should just do it without seperate nuget packages for each configuration?
But the code compiles quite differently depending on the constant, some internal class even doesn't exist in some configurationsUnknown User•4d ago
Message Not Public
Sign In & Join Server To View
Hmm, should I create a seperate folders for each csproj s then?
Ugh, I need to reference the source code outside of the folders then
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
Because I didn't know that
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
Thanks for explaining, it looks pretty handy
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
I haven't figure out how the library user can defineconstant on the referenced project without modifying the referenced project
That's why I did this
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
It's a C++ binding, which has some
size_t
parametersUnknown User•3d ago
Message Not Public
Sign In & Join Server To View
Hmm
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
.NET Runtime Identifier (RID) catalog - .NET
Learn about the runtime identifier (RID) and how RIDs are used in .NET.
Is this the one you've explained?
Hmm, I think I should mess around this out myself
Thanks a lot for telling me about this 🙂
And I thought the CMake alone is enough headache lol
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
Hmm, the link is private for me
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
Yeah, splitting folders resolves the issue, I guess I'll resort to this for now
Thanks again!
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View