-
Notifications
You must be signed in to change notification settings - Fork 20
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
OSOE-819: Constant from JSON source generator #734
Conversation
For some reason I get these with your latest commit: But if I check out the commit before that (92bbfa5) and do a clean and rebuild then it works. However by "works" I mean that I get no errors or warnings in VS from "Build Only". I still see IntelliSense errors: |
This pull request has merge conflicts. Please resolve those before requesting a review. |
@sarahelsaig please try again with the latest version, as for the remaining warnings in visual studio I can't seem to fully get rid of them but they don't seem to be an issue as the build does actually complete succesfully and the constant values are actually showing up in the editor also. |
It works in VS without any build errors or warnings (at least on a freshly cloned repository), so that's good. But I get this warning in Intellisense-only mode: |
I really don't want us to have a warning that's actually OK. It's detrimental conditioning for the development team. It doesn't matter if it's generated somewhere, but it shouldn't be surfaced as a warning. If you can turn it into a message, or otherwise hide it, then that's fine. |
@sarahelsaig @Piedone So it does really look like a weird issue with VS in this instance. We could add a Let me know what you both think we should do in this case |
Related, perhaps? dotnet/roslyn#54899 Though it's about native assemblies. Isn't the issue related to the assembly targeting netstandard? It can target .NET 8 too, it'll be used by OC modules, which are all .NET 8. |
I did come across that post and it does seem to be about referencing native assemblies from the source generator. In our case it's about a local reference from a project referencing / using the source generator. As for targetting netstandard2.0 from the source generator this is unfortunately a hard requirement for source generators to work. |
Then please suppress this warning if it's possible to do just the affected projects, commented why it's necessary, pointing to some common docs in HL where you also tell consumers to do this in their projects. |
@sarahelsaig @Piedone If so I am kind of running out of ideas on how to suppress this warning any further or what else to try, and it's starting to take up way too much time digging into this niche issue. Open to any suggestions though so please let me know how you think we should proceed. |
For me too. However, the DLL actually indeed doesn't exist for me when opening the solution. So, perhaps you need to fix that instead? |
Indeed it doesn't exist when the project is freshly cloned and opened for the first time in VS. It does however exist after the first build, I guess that is just a quirk of referencing source generators locally in this way. After that first build the warning doesn't seem to come back anymore (even after a clean of the solution). Again I am open for suggestions on how to either solve this or suppress the warning further but as I mentioned I have kind of run out of things to try at this point. Only thing I can think of right now is maybe open up an issue over at https://github.com/dotnet/roslyn and see if they have any ideas? |
Well, I suggest fixing that the DLL doesn't exist :). The warning is not a false positive. You can either make the DLL exist (perhaps by hooking into an MSBuild target that's executed when the project is loaded and doing some kind of pre-build) or the reference to only be active when it exists (you can add conditions to csproj elements). Feel free to additionally ask under the Roslyn repo too (though I suggest a discussion, since this is a question, not a bug of Roslyn). |
This pull request has merge conflicts. Please resolve those before requesting a review. |
@Piedone See the reply on the discusson dotnet/roslyn#72937 (comment) please let me know how you want to proceed. |
Hey @sarahelsaig , I think we are finally ready to review this again and hopefully actually merge it in this time! |
This pull request has merge conflicts. Please resolve those before requesting a review. |
This comment has been minimized.
This comment has been minimized.
This pull request has merge conflicts. Please resolve those before requesting a review. |
This pull request has merge conflicts. Please resolve those before requesting a review. |
Hey @sarahelsaig with those issues resolved is it ready to be merged? |
OSOE-819
Also see: Lombiq/Helpful-Libraries#251
Lombiq/Orchard-Vue.js#134
Lombiq/Orchard-Base-Theme#109