Option for New Xamarin.Forms Items Has Dissappeared

NPCNPC USMember ✭✭

For my large project (this does not effect other projects) there is no longer any Forms items under Add -> New Item. I cannot make a new XAML template. I would imagine this is tied to me changing the target platform to .Net Standard, then quickly back to .Net Portable. Are there any settings that I can control to see where it may be searching for these templates?

Best Answer

  • mattwardmattward GB Xamurai
    Accepted Answer

    There is a bug in Visual Studio for Mac 7.0 where it does not allow Forms file templates to be added to projects that use a project.json file or is a project that uses PackageReferences. This should be fixed in Visual Studio for Mac 7.1 which is currently available in the beta channel.

Answers

  • mattwardmattward GBMember Xamurai
    Accepted Answer

    There is a bug in Visual Studio for Mac 7.0 where it does not allow Forms file templates to be added to projects that use a project.json file or is a project that uses PackageReferences. This should be fixed in Visual Studio for Mac 7.1 which is currently available in the beta channel.

  • NPCNPC USMember ✭✭

    Thank you. Is it possible for me to repair this?

  • mattwardmattward GBMember Xamurai
    edited July 2017

    If you do not mind editing the Xamarin.Forms template files. I would take a backup first of the files first. The templates are available in:

    /Applications/Visual\ Studio.app/Contents/Resources/lib/monodevelop/AddIns/Xamarin.Forms.Addin/Templates/
    

    So taking the Forms-ContentView-Xaml.xft.xml as an example, if you edit that file and remove the following part:

    <Conditions>
        <HasReference Assembly="Xamarin.Forms" />
    </Conditions>
    

    Or just comment it out using <!-- -->.

    Then restart Visual Studio for Mac 7.0 then the ContentView file template should be available for any project.

  • NPCNPC USMember ✭✭

    Worked like a charm! You've been beyond helpful in these forums Matt

Sign In or Register to comment.