Forum Cross Platform with Xamarin

How do I create Xamarin.Formsbook.Toolkit with VS 15.5.2?

I am trying to create the Xamarin.Formsbook.Toolkit in preparation for a class I'm teaching. The old way to create it doesn't exist in the latest version of Visual Studio. I have tried selecting Cross Platform, but the only options are app and UI Test. I created a project using C# .NET Standard 2.0, then added Xamarin.Forms NuGet package, but that doesn't work either.

How can I create this class library?

Best Answers

Answers

  • kentuckerkentucker USMember ✭✭✭✭✭

    Not really sure what you are asking? Cant you add Xamarin.Formsbook.Toolkit to the project with NuGet?

  • RandyGuayRandyGuay USMember ✭✭

    When VS had the PCL option, one of the things you could make was a class library. Since going to .NET, that option is gone. I can't figure out how to make the class library. There are incompatibilities between the sample code and the current version of Visual Studio. You can't just include that code with new code and have it work.

    I had created the toolkit class library from VS in October 2017 and that works. But I am teaching students how to program using the Xamarin.Forms environment. They need to be able to create their own class libraries.

  • kentuckerkentucker USMember ✭✭✭✭✭

    PCL were replaced by .net standard class libraries. They work cross platform and support multiple platforms

  • RandyGuayRandyGuay USMember ✭✭

    When I create a .net standard project and try to add a XAML file with code-behind .cs, I get build errors
    1>------ Rebuild All started: Project: Xamarin.Forms.Toolkit, Configuration: Debug Any CPU ------
    1>HSL.xaml.cs(8,21,8,25): error CS0234: The type or namespace name 'Xaml' does not exist in the namespace 'Xamarin.Forms' (are you missing an assembly reference?)
    1>HSL.xaml.cs(13,29,13,40): error CS0246: The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?)
    1>HSL.xaml.cs(12,3,12,18): error CS0246: The type or namespace name 'XamlCompilationAttribute' could not be found (are you missing a using directive or an assembly reference?)
    1>HSL.xaml.cs(12,3,12,18): error CS0246: The type or namespace name 'XamlCompilation' could not be found (are you missing a using directive or an assembly reference?)
    1>HSL.xaml.cs(12,19,12,41): error CS0103: The name 'XamlCompilationOptions' does not exist in the current context
    1>Done building project "Xamarin.Forms.Toolkit.csproj" -- FAILED.
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    What am I supposed to add to the .net project to be able to use XAML?

  • RandyGuayRandyGuay USMember ✭✭

    Thanks, emach47. But what I was really trying to do was build a new library from scratch. I was finally able to do this by creating a new solution and deleting all the default content. When I was trying this, the source code had been updated but not the Windows projects, so nothing worked. The latest master.zip file now works on Windows.

Sign In or Register to comment.