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

SourceGenerator Error #518

Closed
zhuxianzhiniko opened this issue May 22, 2023 · 2 comments
Closed

SourceGenerator Error #518

zhuxianzhiniko opened this issue May 22, 2023 · 2 comments

Comments

@zhuxianzhiniko
Copy link

Hi, after I use [Inject] for Field Injection, SourceGenerator will have a reference exception.

After I tested, I found that this error will appear as long as I use namespace. If I remove the namespace, SourceGenerator can work normally.

Log:
Container.SourceGenerator\VContainer.SourceGenerator.VContainerSourceGenerator\TestGeneratedInjector.g.cs(18,39): error CS0246: The type or namespace name 'TestNamespace' could not be found (are you missing a using directive or an assembly reference? )

VContainer :1.13.2
Unity: 2022.2.19f1

This is a minimal case
VContainerTest.zip

@zhuxianzhiniko
Copy link
Author

I found that it can be easily fixed.

Just modify VContainerSourceGenerator.cs, line 222

fieldSymbol.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);

@hadashiA
Copy link
Owner

hadashiA commented Jul 5, 2023

Fixed in #532. Thanks for the report.

@hadashiA hadashiA closed this as completed Jul 5, 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

2 participants