-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
HotChocolateImplicitUsings does not work in Directory.Build.props #6775
Comments
@michaelstaib your response doesn't seem to match the problem. Did you perhaps comment on the wrong issue / linked the wrong PR for resolution? I'm running into the same original problem integrating Hot Chocolate into our Monolith, where each usage of |
This HotChocolateImplicitUsings>disable</HotChocolateImplicitUsings does not work? |
It is opt-in. There is a global opt-in in .Net and a package by package opt-out. |
Yes. What do you mean by global opt-in in .NET? I can't remember opting in at one point. |
Currently (13.x) you need to add this MSBuild prop to each
It's a little confusing, but This is why @michaelstaib said there's a "global opt-in" and a package by package opt-out. You can't enable implicit usings for only 1 package and then have it disabled for all other packages and sources - including .NET framework. |
I think I can fix this ... I will report back. |
Awesome. Thanks Michael! |
Please test and give feedback |
Can confirm that it works in |
Is there an existing issue for this?
Product
Hot Chocolate
Describe the bug
When I add Hot Chocolate to my project I get all of the global usings configured in the library.
These are disabled by adding
<HotChocolateImplicitUsings>disable</HotChocolateImplicitUsings>
to my.csproj
.If I have several projects in a solution that reference Hot Chocolate, I have to add
<HotChocolateImplicitUsings>disable</HotChocolateImplicitUsings>
to every single project because this setting doesn't appear to work when I add it to my solutions'Directory.Build.props
.I would appreciate being able to not have to disable global usings that I never asked for. I'm glad I can disable them when including Hot Chocolate, but I wish I could disable them globally with
Directory.Build.props
to make project maintenance easier.Steps to reproduce
HotChocolate
NuGet package<HotChocolateImplicitUsings>disable</HotChocolateImplicitUsings>
to theDirectory.Build.props
for the solutionRelevant log output
No response
Additional Context?
I found this setting in a GitHub issue after adding Hot Chocolate caused my project to stop building because Hot Chocolate types conflicted with types already in my application!
I wish adding a NuGet package (without using any of it's types in my code) didn't cause my project to stop compiling 😔.
In my case, it's the GreenDonut.Result type that is conflicting with a
Result
type I have in my project.Version
13.7.0
The text was updated successfully, but these errors were encountered: