You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bindings from $(AndroidJavaSource) don't work with Intellisense #7692
.NET 7's $(AndroidJavaSource) is great for simplifying several binding tasks. However, while it compiles on a build, the .cs files it generates do not get added to the files used by IntelliSense, and thus trying to consume the bindings is difficult because they do not show up in IntelliSense dropdowns and show as errors in the editor.
Looking at a design time build, this appears to be because they are never added to @(Compile) which is used by <Csc>:
For comparison, it appears we add Resources.designer.cs to @(Compile) when $(ManagedDesignTimeBuild)' == 'True'.
Target "AddBindingsToCompile" skipped, due to false condition; ( '$(_AndroidGenerateManagedBindings)' == 'true' ) was evaluated as ( '' == 'true' ).
_AndroidGenerateManagedBindings is empty, probably because we are not evaluating it.
I'm not sure we want to do a Java build in the DTB though....
If its done already and the source has been generated the we should include it. But I'm not sure about doing a java compile at that time though.
Hi, we have the same problem in my company. it makes this feature totally unusable, don't wait for .net8. The release is scheduled for November it's too long for a bug fix. Thanks
@jonathanpeppers Thanks for tour Quick response. I tried to separate in a library but I had the same problem. I feel like it's more related to the new csproj format. I will try again tomorrow.
Activity
dellis1972 commentedon Jan 12, 2023
My gut says that
AddBindingsToCompileis not being called during a Design Time Build.dellis1972 commentedon Jan 12, 2023
Yup
_AndroidGenerateManagedBindingsis empty, probably because we are not evaluating it.I'm not sure we want to do a Java build in the DTB though....
If its done already and the source has been generated the we should include it. But I'm not sure about doing a java compile at that time though.
mohachouch commentedon Mar 7, 2023
Hi, we have the same problem in my company. it makes this feature totally unusable, don't wait for .net8. The release is scheduled for November it's too long for a bug fix. Thanks
jonathanpeppers commentedon Mar 7, 2023
@mohachouch as a workaround, I think you can just put the
.javafile in a separate class library? Did you try that?Then Intellisense should be able to use the compiled
.dllon disk in that case.mohachouch commentedon Mar 7, 2023
@jonathanpeppers Thanks for tour Quick response. I tried to separate in a library but I had the same problem. I feel like it's more related to the new csproj format. I will try again tomorrow.
jonathanpeppers commentedon Mar 7, 2023
I hit similar issues working on:
https://github.com/jonathanpeppers/spice/blob/main/src/Spice/Platforms/Android/Interop.java
I spent a little time on it, but I didn't see an immediately, easy fix.
mohachouch commentedon Mar 8, 2023
Hi @jonathanpeppers,
I have the same bug with seperate class library : https://github.com/mohachouch/JavaBindingBug
The compilation is ok but intelisense not working for both
Thanks
mohachouch commentedon Mar 9, 2023
Hi @jonathanpeppers do you reproduce the bug?
mohachouch commentedon Mar 14, 2023
Any news @jonathanpeppers ?
jonathanpeppers commentedon Mar 15, 2023
Please others upvote, if this impacts you. This helps us know how important it is.
I'm currently working on MAUI issues that have a lot louder feedback. 👀
mohachouch commentedon Aug 15, 2023
Hi @jonathanpeppers,
Any News about this bug ? This bug is present since .net 6, so since 2 years.
Thanks
[Xamarin.Android.Build.Tasks] Include Bindings Design Time builds (#8357
[Xamarin.Android.Build.Tasks] Include Bindings Design Time builds (#8357
[Xamarin.Android.Build.Tasks] Include Bindings Design Time builds (#8357