Skip to content
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

Ambiguous reference in projects that have transitive dependencies on both MassTransit.Abstractions and NewId #22

Closed
smarts opened this issue Dec 4, 2022 · 5 comments

Comments

@smarts
Copy link

smarts commented Dec 4, 2022

In projects that have dependencies on both MassTransit.Abstractions and NewId, the compiler has no way to tell the difference between usages because the class names and namespaces are identical.
@phatboyg have you considered making a breaking change and choosing a new namespace for this standalone library/package?

Edit: I'm aware that having both dependencies is a no-no if you can avoid it, but given that they could be transitive dependencies via NuGet, there are scenarios for which it cannot easily be avoided.

@phatboyg
Copy link
Owner

phatboyg commented Dec 4, 2022

This was intentional to prevent two separate packages using the same algorithm from generating the same identifiers. While I can understand the transitive package issue, a better option might be an empty NewId package – but I don't think that would work either.

@smarts
Copy link
Author

smarts commented Dec 6, 2022

Yeah, sorry. I did not mean to be prescriptive about a solution. That was just the first one that came to mind.

@phatboyg
Copy link
Owner

phatboyg commented Dec 6, 2022

Right, I get it. Eliminating the old package from your dependency chain would be the best course of action.

@UtopleMan
Copy link

Fantastic ID generator you guys have made here! Sorry if I'm being ignorant here, but wouldn't it be much easier to just keep it in it's own separate namespace, like "NewId" or..?

@phatboyg
Copy link
Owner

phatboyg commented Dec 12, 2022

Fantastic ID generator you guys have made here! Sorry if I'm being ignorant here, but wouldn't it be much easier to just keep it in it's own separate namespace, like "NewId" or..?

Long story, but NewId was originally in MassTransit, later it was moved out to use it in other projects but the namespace remained the same to avoid breaking compatibility/builds. Now it's back in MassTransit.Abstractions (no namespace change required).

The problem with pushing a new v4 with the NewId namespace would be the duplication of the logic in the same process (people will screw up, they do it all the time and end up using both) resulting in duplicate Guids.

OH, and the whole static class with the same name as the namespace nonsense.

@phatboyg phatboyg closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants