C
C#4mo 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
Patrick4mo 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 Tacoz4mo 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
Patrick4mo ago
then go to another language, lol
Tacti Tacoz
Tacti Tacoz4mo ago
Well that isn’t helpful 😦
Patrick
Patrick4mo ago
neither is being stubborn in the face of how to do this properly in .NET
Tacti Tacoz
Tacti Tacoz4mo ago
It’s a compiler limitation not a .net limitation
Angius
Angius4mo ago
Guess what the compiler is a part of
Tacti Tacoz
Tacti Tacoz4mo ago
Is msbuild a part of the clr? No.
Angius
Angius4mo ago
It's a part of the generic umbrella term ".NET" So, yes, the compiler "limitation" is a .NET limitation
Patrick
Patrick4mo 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 Tacoz4mo 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
MODiX4mo ago
Patrick
then go to another language, lol
Quoted by
<@104975006542372864> from #Circular References (click here)
React with ❌ to remove this embed.
Patrick
Patrick4mo ago
which is ironic, considering the context of the question.
Tacti Tacoz
Tacti Tacoz4mo ago
It does make sense, and it would work just fine in Roslyn’s perspective
Angius
Angius4mo ago
We're firmly in the "I should be able to eat soup with a fork!" territory
Patrick
Patrick4mo ago
why not open a discussion on the roslyn repository 🙂
Tacti Tacoz
Tacti Tacoz4mo ago
How? This is an msbuild problem not Roslyn
Angius
Angius4mo 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
Patrick4mo ago
I'm beginning to think you opened this just to be pedanitc
Tacti Tacoz
Tacti Tacoz4mo ago
Roslyn supports what I want
Patrick
Patrick4mo ago
this isn't how it's intended to work is that enough?
Tacti Tacoz
Tacti Tacoz4mo 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
Patrick4mo 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 Tacoz4mo ago
And I respectfully disagree in part due to the fact Roslyn supports it natively on its own
Patrick
Patrick4mo 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
Denis4mo ago
Just because you have goto doesn't mean you should use it.
Tacti Tacoz
Tacti Tacoz4mo ago
But I don’t even have go to though I got go F off 🤷‍♂️
Denis
Denis4mo ago
Dude... You got the answer in a very respectful manner
leowest
leowest4mo 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 Tacoz4mo ago
Being told to F off in the most respectable way perhaps
Patrick
Patrick4mo 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 Tacoz4mo 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
leowest4mo 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 Tacoz4mo ago
You may not be but the two others sure are
leowest
leowest4mo 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 Tacoz4mo 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
Patrick4mo ago
I see.
Denis
Denis4mo ago
Fork the ide too then
Tacti Tacoz
Tacti Tacoz4mo 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
More Posts
How can I decode Avro Message that have an embedded schema and after the message content?How can I decode Avro Message that have an embedded schema and after the message content. I receiveMsgbox helphow can i create a msgbox with custom "dialog button", i mean, not a form, a msgbox with custom dialhow can I make it so that it doesn't need to open up a whole new MainWindow when I try to go back?https://cdn.discordapp.com/attachments/169726357331378176/1209213220758364281/unknown_2024.02.19-19.Trying to understand this abstract code (and use it elsewhere)``` using System; using System.Collections; using System.Collections.Generic; using UnityEngine; puBlazor Server: Cannot access a closed StreamI'm trying to export a list of objects to a csv and then make the user download it. I'm getting an eMediatR in Class LibraryI have an application that's broken up in 3 parts: API, Blazor, and Class Library. The Class Library2 actions in one methodHey there, I am new to C# and ASP.NET, what I am trying to accomplish now is to make account area whMathPlugin in skprompt.txt file [Semantic kernel]What is proper way to set params in skprompt.txt file to call MathPlugin.Add function: ``` Console.Nuget Package: Project Reference Mutli Runtime TargetingHey Folks, I have a nuget package that wraps an exe, which I need to run on both linux and windows.interfacing with google cloud api for cloud translate, getting error for bad requestas title says, when calling my api key i get an error "invalid uri the uri string is too long"