Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
For a Xamarin Forms project, the following XAML builds fine regardless of whether it's in a PCL or Shared Project:
<ContentPage x:Class="MyApp.MyView" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MyApp">
Although builds always work, the development experience differs between PCL and Shared Project. In a PCL project, everything is fine. In a shared project, however, IntelliSense reports these errors:
The type 'Grid' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
The type 'ContentPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
The errors go away after a successful build, but immediately reappear after you save a change to the XAML file. The problem occurs regardless of whether the Custom Tool is MSBuild:UpdateDesignTimeXaml or MSBuild:UpdateDesignTimeXaml.
Potentially relevant: https://github.com/dotnet/project-system/issues/485 and https://devdiv.visualstudio.com/DevDiv/_workitems/edit/404636
The first one is known to be an issue in some scenarios involving the CPS-based NETStandard project system, which a shared project also uses.
It's being tracked for resolution in a future release.
If you would like to keep track of it on the VS side, I'd suggest you report the issue from the "Send Feedback" functionality in VS, since this is external to Xamarin.
Thanks for reporting!
Reported as Visual Studio bug: https://developercommunity.visualstudio.com/content/problem/41028/xaml-in-shared-project-causes-intellisense-errors.html