C
C#10mo ago
Tacti Tacoz

✅ Circular References

Being unable to do circular references seems like an unnecessary roadblock in some cases, at least for private projects. See the following example. (Image) Common represent a general helper project, while Pool project represent, for the purposes of this example, memory management helpers. Pool benift from the Common helpers, but Common also uses some memory management helpers internally. They are separate projects for code cleanliness reasons and also for the fact that they contain quite different functionality in general and could be used independently. Obviously I am aware that leaving one of their resulting dlls out if this was allowed would cause some features in the remaining dll to break, that isn't the point. Way 1 of fixing this "properly" is to add a Common Common project for the common project where the very very common code goes... Sure. At that point the natural progression of things is way 2. Way 2 of fixing this "properly" would be to merge the two dlls or internally implement whatever are needed from each other which is generally what I have done. But both is extremely ugly, I have them separated for a reason. And some projects implement types that are exposed publicly so would require exposing duplicate of such types which is a mess in it self. Another way is to reference the resulting dlls of a project instead of an actual project reference, which is pretty hacky and breaks ide features. It's also pretty interesting that if editing the .csproj file manually visual studio basically fails to load the projects properly silently in terms of code analysis but then msbuild breaks with a nuget error code? Rider is mostly the same. Don't tell me the only reason this is hard blocked is because nuget doesn't allow it? I have exactly zero interest in uploading anything to nuget anyway, why does nugets dependency rules effect the entire language? You can tell me it's bad coding in general to do circular references all you want, It certainly would be if the projects were intended to be published independently / publicly but they are not. It's just for basic organization and is not for public release. Am I willing to make pointless abstractions to half of my code for no reason? No.
No description
40 Replies
Patrick
Patrick10mo ago
I don't think it matters if it's a private/personal project or not, it's a chicken and egg scenario it doesn't make logical sense. You cannot compile one, without the other It's not much of a common project, if it then relies on another project. Break common's dependency on pool 🙂
Tacti Tacoz
Tacti TacozOP10mo ago
Roslyn doesn’t require a reference to be a compiled dll file though. A compilation reference can be another compilation. It can be done if the devs of msbuild were willing to do it. It isn’t a clr violation either. So no I don’t see it as a chicken or egg scenario since neither project needs to be fully compiled to reference eachother.
Patrick
Patrick10mo ago
then go to another language, lol
Tacti Tacoz
Tacti TacozOP10mo ago
Well that isn’t helpful 😦
Patrick
Patrick10mo ago
neither is being stubborn in the face of how to do this properly in .NET
Tacti Tacoz
Tacti TacozOP10mo ago
It’s a compiler limitation not a .net limitation
Angius
Angius10mo ago
Guess what the compiler is a part of
Tacti Tacoz
Tacti TacozOP10mo ago
Is msbuild a part of the clr? No.
Angius
Angius10mo ago
It's a part of the generic umbrella term ".NET" So, yes, the compiler "limitation" is a .NET limitation
Patrick
Patrick10mo ago
there's more to .NET than the CLR .NET is an ecosystem getting hung up on semantics also doesn't really matter. You can't do what you want because it doesn't make sense in this world.
Tacti Tacoz
Tacti TacozOP10mo ago
The result would have been the same if all the code where in the same compilation, the limitation of not allowing me to organize within the means of the project structure is arbitrary.
MODiX
MODiX10mo ago
Patrick
then go to another language, lol
Quoted by
<@104975006542372864> from #Circular References (click here)
React with ❌ to remove this embed.
Patrick
Patrick10mo ago
which is ironic, considering the context of the question.
Tacti Tacoz
Tacti TacozOP10mo ago
It does make sense, and it would work just fine in Roslyn’s perspective
Angius
Angius10mo ago
We're firmly in the "I should be able to eat soup with a fork!" territory
Patrick
Patrick10mo ago
why not open a discussion on the roslyn repository 🙂
Tacti Tacoz
Tacti TacozOP10mo ago
How? This is an msbuild problem not Roslyn
Angius
Angius10mo ago
"You can't eat soup with a fork, it will leak" "But I should be able to!" "You can't, it makes no sense" "But it does!"
Patrick
Patrick10mo ago
I'm beginning to think you opened this just to be pedanitc
Tacti Tacoz
Tacti TacozOP10mo ago
Roslyn supports what I want
Patrick
Patrick10mo ago
this isn't how it's intended to work is that enough?
Tacti Tacoz
Tacti TacozOP10mo ago
I opened a post to hear if there were a reasonable solution that didn’t involve A. Merging all my general purpose library and B. Doesn’t involve causing unessesary abstraction. All I got was to be told to find a different programming language and that same person and another that keeps spamming the same logical falciy reference that are irallivant due to what I explained above.
Patrick
Patrick10mo ago
No, you were told it's not logical in .NET you proceeded to ignore the only right answer, so were told to find a language where it's ok to do that
Tacti Tacoz
Tacti TacozOP10mo ago
And I respectfully disagree in part due to the fact Roslyn supports it natively on its own
Patrick
Patrick10mo ago
you've come here looking for a specific answer, cannot get said answer, and are upset that your way of thinking doesn't align with the .NET team ergo, .NET is not for you it doesn't matter if you disagree I don't know what part of this is up for debate
Denis
Denis10mo ago
Just because you have goto doesn't mean you should use it.
Tacti Tacoz
Tacti TacozOP10mo ago
But I don’t even have go to though I got go F off 🤷‍♂️
Denis
Denis10mo ago
Dude... You got the answer in a very respectful manner
leowest
leowest10mo ago
you believe its possible, u dont want to take the word of experienced people and u believe the problem is msbuild, then file an issue there and see how it goes... https://github.com/dotnet/msbuild
Tacti Tacoz
Tacti TacozOP10mo ago
Being told to F off in the most respectable way perhaps
Patrick
Patrick10mo ago
Jesting about going to another language when you're clearly experienced enough to understand CLR and other components that make up your .NET experience doesn't equate to telling you to fuck off
Tacti Tacoz
Tacti TacozOP10mo ago
I know it can be done natively with Roslyn since I am actively doing so. It seems you poeple have declared it not to be so though, so I do indeed doubt it will help me much
leowest
leowest10mo ago
im not declaring anything, I am pointing you to the direction to make it happen or be told its not going to happen discussing here wont change that, you either file it as a issue and see what happens or argue here for no reason
Tacti Tacoz
Tacti TacozOP10mo ago
You may not be but the two others sure are
leowest
leowest10mo ago
well its up to you if u sit here discussing what is possible or not vs getting it in the right place and either getting a "no this is not something planned" or a "we will consider this"
Tacti Tacoz
Tacti TacozOP10mo ago
Well fair enough then. Hoesntly I would have forked Roslyn for years ago if it wasn’t for the fact I would lose all ide comparability
Patrick
Patrick10mo ago
I see.
Denis
Denis10mo ago
Fork the ide too then
Tacti Tacoz
Tacti TacozOP10mo ago
Pretty sure both visual studio and rider is closed source. Visual studio doesn’t even support filtering out auto fill suggestions. And to be fair I do got actual work to do at some point… Well anyway guys thanks for confirming me know that there is no supported work around at least
Want results from more Discord servers?
Add your server