Any plans to improve multi-targeting support? RRS feed

  • Question

  • User50109 posted

    I've just started working on a new cross platform library, and decided to try out the new multitargeting support that came about with the project format.

    I based my work on Oren Novotny's "Multi-targeting the world: a single project to rule them all" and the GitHub project "XamarinCommunityToolkit". (The forum says I need to be around a bit longer to post links).

    For the most part, it works well... in Visual Studio on Windows. It seems VS for Mac does not really understand it. From reading the log, I think it only builds the first TFM, and no intellisense works for iOS or Android code. I also get various odd compiler errors based on specific things I do (like when referencing an iOS library project, it says it can't find any project info).

    Monday, March 19, 2018 10:34 AM

All replies

  • User18049 posted

    Yes there are plans to improve multi-target support:


    Currently, as you have found, Visual Studio for Mac just uses the first target framework it finds.

    Monday, March 19, 2018 2:46 PM
  • User650 posted

    @mattward any news on this? Seems the board on Github with no changes. There are several libraries around that can't be built on Mac.

    Do you have any recommendations or workarounds to make this kind of projects work on Mac?

    Wednesday, August 22, 2018 1:18 PM
  • User18049 posted

    No update on this.

    There is no good workaround. Whilst you could disable automatic NuGet package restore in preferences, to prevent Visual Studio for Mac generating an incorrect project.assets.json file, building would still treat the project as though it only had one target framework.

    Wednesday, August 22, 2018 3:13 PM
  • User372105 posted

    What about the Multiplatform template?: https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/nuget-multiplatform-libraries/single-codebase https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/nuget-multiplatform-libraries/platform-specific

    Thursday, July 18, 2019 4:24 PM