Forum Visual Studio
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Android axml designer isn't working in F# projects in Visual Studio?

I can't open any of my layout axml files in the designer in Visual Studio - I only have the source view.

This is only affecting F# projects. New F# projects have the same issue.

C# projects work normally. I'm currently using this as a workaround, opening and editing the layouts from a C# project. It's a PITA.

I have updated Xamarin and the android SDK, and the problem remains.

The designer gives me this error message and stack trace:

System.NullReferenceException: Object reference not set to an instance of an object. at Xamarin.VisualStudio.Android.MonoAndroidDesignerInterface.VisualStudioCodeModelBridge.get_EnclosingProject() in C:\data\lanes\3513\c4382f51\source\xamarinvs\src\Core\VisualStudio.Android\Designer\MonoAndroidDesignerInterface.cs:line 180 at Xamarin.AndroidDesigner.CodeInteractions.CodeModelBridge.<GetCompilationAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.CodeInteractions.CodeModelBridge.<GetDesignerResourceEntries>d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.DesignerProject.<UpdateDesignerResourceIds>d__175.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.DesignerProject.<EnsureLoaded>d__139.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.AndroidRenderSession.<InitSession>d__105.MoveNext()

I'd rather not have to do a clean install of Visual Studio and Xamarin, because doing so will stop me from being able to work for much of the day.

Is there a way of getting the designer to work properly for F# projects? Or is there anything else I need to check to get more information?

Thanks,

Answers

  • JohnCottonJohnCotton USMember

    I have the same problem in VS Community 2015. A new blank C# app has a working designer but an F# one doesn't. I've tried reinstalling Xamarin and applying VS Update 3 but it doesn't make a difference.

  • AshleyGazichAshleyGazich USMember, Xamarin Team Xamurai
    edited April 2017

    I will now close this thread to consolidate any further discussion and updates onto the following corresponding public bug report: Bug 44956.


    (I'm also happy to reopen the thread upon request within the next month or two. Just send a quick email to [email protected] with a link to this thread. For follow-up after the next couple of months, if the remaining related open bug reports or forum threads do not cover the desired scenario, please follow the recommendations to file a new bug report or create a new forum thread. Thanks!)

This discussion has been closed.