In Visual Studio 2013, editing XAML files has suggestions from intellisense, as shown in the image below. While not perfect, they usually worked.
But I don't seem to have the same functionality in VS 2015 (despite Xamarin being installed here and the project building perfectly fine). Not only is there no Xamarin-specific intellisense (just generic XML intellisense), but VS issues messages (which it flags as errors) like:
The type 'ContentPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
Which also didn't happen in VS 2013.
Is VS 2015 officially supported? The installer seemed to imply it was and this is the only regression I've seen so far. This is on the RC version (14.0.22823.1) and with Xamarin for Visual Studio 3.11.666. This seems to be the most recent version.
Hi all, Intellisense for Xamarin.Forms XAML files in VS 2015 does indeed use a different approach from the "Xamarin.Forms Intellisense" extension that is used in VS 2013.
The new approach depends on an update to the Xamarin.Forms NuGet package. The new NuGet package that includes those dependencies has not yet been released (the Xamarin.Forms team is working to get it ready for release as soon as possible).
Hi everyone,
In the meantime you can try this[1] to bring back XF IntelliSense until XF releases an official fix.
Just a heads up I got this working on my clean VS 2015 on Windows 10. NO Resharper is installed.
Follow https://forums.xamarin.com/discussion/comment/142079/#Comment_142079, however when you download it on each dll listed go to properties and ensure that Windows did not block the file. I had to check "Unblock" on each. You have to do each file separate or the option will not show. After that boom intellisense.
To summarize:
Bug 32622 - [XamarinVS] Intellisense shows errors in VS 2015 when referencing certain types in app projects from PCL projects (due to the new Roslyn-based Intellisense in VS 2015). (This one is a bug in the XamarinVS extensions themselves. It only affects VS 2015. The tentative plan is to ship the fix in Cycle 5 – Service Release 4 later this month, after Service Release 3 has been promoted to Stable.) Workaround: see Comment 4 on the bug report.
Example error messages:
Bug 32341 - [Xamarin.Forms] Intellisense on code behind files for XAML pages is not available for InitializeComponent()
or for elements of the XAML page that include the x:Name
attribute. (This is a bug in Xamarin.Forms. It affects all versions of Visual Studio.). Possible workarounds: Downgrade to Xamarin.Forms 1.4.3.x (or earlier), or try changing:
<Target Name="UpdateDesignTimeXaml" Condition="'$(UseHostCompilerIfAvailable)' == 'true'" DependsOnTargets="Compile"/>
... to:
<Target Name="UpdateDesignTimeXaml" Condition="'$(UseHostCompilerIfAvailable)' == 'true'" DependsOnTargets="PrepareResources; Compile"/>
... in packages\Xamarin.Forms.1.4.4.*\build\portable*\Xamarin.Forms.targets
[Xamarin.Forms] Intellisense in VS 2015 does not work within XAML pages themselves, as discussed in the first comment on http://forums.xamarin.com/discussion/46185/visual-studio-2015-intellisense-regression-when-editing-xaml-files/p1. (This is a bug in Xamarin.Forms caused by a change in the "ownership" of Intellisense from the XamarinVS extensions into the Xamarin.Forms NuGet package. It only affects VS 2015.) Workaround: (discussed at the top of this thread). Reports of freezes related to this workaround are under investigation. If anyone would like, you can try collecting a stack trace from the frozen instance of VS, for example using the steps here. You can file that stack trace in a bug report, email it to the VS team (as mentioned by Daniel later in the thread), or if needed simply attach it to a comment at the end of this forum thread.
Answers
Same here. Intellisense doesn't work despite the mention in the release notes:
Same problem here, too - would like to use Xamarin also from Visual Studio 2015...
+1
me too...
+1
I'm now using Xamarin in VS2015, but I need to ignore the "Errors". Very annoying to program like this
+1 Here
My understanding was that VS2015 was changing the way xaml intellisense worked, but that support was targeted for RTM. It doesn't look like that's happened. I don't think I'll use VS2015 for Xamarin.Forms until this changes.
No intellisense for me either in VS 2015.
Hi all, Intellisense for Xamarin.Forms XAML files in VS 2015 does indeed use a different approach from the "Xamarin.Forms Intellisense" extension that is used in VS 2013.
The new approach depends on an update to the Xamarin.Forms NuGet package. The new NuGet package that includes those dependencies has not yet been released (the Xamarin.Forms team is working to get it ready for release as soon as possible).
What is the ETA of the new Xamarin.Forms Nuget package? (Or is it already in Alpha/Beta?)
+1 I can't program like this...
What is the ETA, please?
@BrendanZagaeski
If everything goes smoothly with some remaining open bugs, I believe the Xamarin.Forms team's current objective is to upload a new pre-release that includes the Intellisense dependencies on Monday July 27. Again, there are some open bugs that need to be resolved first, so this estimate is still subject to change.
@BrendanZagaeski Alright, I'm eagerly waiting for that pre-release! Thanks.
Hi everyone,
In the meantime you can try this[1] to bring back XF IntelliSense until XF releases an official fix.
[1] http://xvs.xamarin.com/Xamarin.Forms.Intellisense.zip
@VGA I followed the readme file but it doesn't work for me. I'm using VS2015 rtm.
How does these get picked up by visual studio? Do I need to do something special in my xaml files?
@VGA thanks, it worked
goodbye blue lines of hell!
@opiants Are you sure you followed the readme? All I did was close VS15 (I'm also on RTM), then I went to my project's folder/packages/xamarin forms 1.4.3/lib and copied those DLLs to every single folder there. After that I just started VS and it was all good! Try to do the process the way I did.
Good luck!
@EroStein Yes, I did. Did you add it in the Design folder?
EDIT: Tried on another computer but still can't get it to work. I'm not sure what I'm missing here. How does VS pick this dlls up for intellisense anyway?
opiants
Having the same problem. Copied according to instructions but no intellisense
Tried with Xamarin.Forms 1.4.4.6376 & 1.4.4.6379-pre3 with the following IDE setup:
Microsoft Visual Studio Professional 2015 RC
Version 14.0.22823.1 D14REL
Installed Version: Professional
Xamarin 3.11.666.0 (ebae43a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 5.1.4.16 (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
Visual Studio plugin to enable development for Xamarin.Android.
Xamarin.iOS 8.10.2.0 (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
Visual Studio extension to enable development for Xamarin.iOS.
@opiants Weird, all I did was follow the instructions and it worked.
Maybe it's your forms version? I'm using Xamarin.Forms.1.4.3.6376. As I said, I closed my VS, copied those DLLs to "MyProjFolder\packages\Xamarin.Forms.1.4.3.6376\lib" and inside every folder I copied those 2 .Design DLLs. That's it, reopened the project and voila... no more blue lines from hell
@opiants One thing that just slipped my mind... do you still get the blue lines or your only problem is IntelliSense? I'm asking because I have ReSharper... so I might not be the best help to let you if the IntelliSense worked. What I can tell you is that now the XAML files are able to find the references and recognize the objects. That's why I think IS should be working as well.
@ErosStein Ahh. so you have Resharper installed? That's probably why you're getting intellisense, no? I'm on the same forms version as you.
@opiants Yup, that's why I asked about the blue lines... because those appear even with ReSharper before running the fix.
Just a heads up I got this working on my clean VS 2015 on Windows 10. NO Resharper is installed.
Follow https://forums.xamarin.com/discussion/comment/142079/#Comment_142079, however when you download it on each dll listed go to properties and ensure that Windows did not block the file. I had to check "Unblock" on each. You have to do each file separate or the option will not show. After that boom intellisense.
@JamesMontemagno That actually worked! Thanks!
Does anyone know how this work though?
This does not work for me (so please marked as not answered). I am using latest XF update 1.4.4 (.6387) and I get blue lines all over my xaml in VS 2015. Applying the suggested fix (copying the two dlls to the XF 1.4.4 packages folder) does not work. This is very irritating.
Can someone please advise when this will be fixed?
@jonathanyates Same here.
Can work around it for now (temporarily using ReSharper trial for XAML intellisense but only 20 days left!) but the intellisense errors are a pita. Can this be expedited please Xamarin folks?
@VGA intellisense doesn't seem to work if the root page is not from Xamarin.Forms assembly.
e.g.
<c:BaseView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:c="clr-namespace:SomeAssembly.Forms.Controls;assembly=SomeAssembly.Forms" x:Class="App1.Forms.Page1"> <Label Text="Test" /> </c:BaseView>
where BaseView is inheriting ContentPage
Any workaround?
Well, I decided to push my luck and updated to w10, now it's not working anymore, not even with the workaround...
@JamesMontemagno @BrendanZagaeski @VGA
@jonathanyates @Marabunta Well, I had this same issue again, after installing W10 (see message above), but after upgrading to XF1.4.4, copying the DLLs again (of course) and running a clean/rebuild worked
without resharper... I haven't installed it yet (it's a fresh W10 installation).
Not only the BLOD are gone but now IS is working even without resharper, which is great... Imma give it a try and see if I can live without the decompiler
check the image
From my previous post, figured out that the fix is simply pasting the default xaml scaffold in the file you're working on, close it then reopen, then paste the original content of the xaml file and intellisense should work again.
@ErosStein I don't what the magic as for it to work for you. It definitely does not work for me. This is a clean install of W10 and VS2015 using XF 1.4.4.6387. Still blue lines all over my xaml
Interestingly the 2 dlls are version 1.4.3.
@jonathanyates Indeed they are, but it's working... Well, all I did was update to forms 1.4.4, add those dlls to the package and restart VS, that was it. Not sure if it matters (it shouldn't), but I'm using VS15 Enterprise.
I actually have a worse issue as well. My code is littered with reported errors with red underlining although the solution builds fine. The offending errors are all related to anything that I am referencing from my Core shared PCL. For example I have a PCL named Weather specific to my app and a PCL named Core for all my Core stuff. Weather references Core and uses it's classes. All builds and runs fine but the code is underlined in Red for any referenced Core stuff including usings, classes and members. I tried removing and adding the reference again which seemed to fix things temporarily, but not for long. My code is now riddled with Red underlining in my code and Blue underlining in my Xaml. See attached screenshot
Anyone else experiencing this and know how to fix it?
The other thing I've noticed is that sometimes the blue xaml underlining goes away, until you edit the xaml and then it comes back again.
@VGA @jonathanyates Exactly what I'm getting. Have tried all the workarounds, some work for a while, some don't. Using VS2015 Enterprise, filter the Error List to "Build Only" get no errors, but change to "Build + Intellisense" get 1200 errors, which are the references to my external PCL libraries. It still builds and runs Ok but is a pain to use. Also only get intellisense when trying @opiants workaround to empty the xaml, save it, reload it and paste in the xaml! Have to do this every time in order to see intellisense though so not really practical - thanks anyway though opiants :-)
Have also created a new vanilla PCL project and problems are the same.
Looks like some problem with the .g.cs file generation at design time maybe, but have to get on with my app for now - any ideas from Xamarin?
@jonathanyates believe me, I feel your pain! I have to unload and reload the WP project several times a day in order for those errors to go away. The project still builds and runs, but it's annoying... Xamarin is awesome, but sometimes it looks like they are still in beta...
@jonathanyates In time... As I said, I've been suffering with those errors since I started my project and what I do is unload and reload the WP project. If you're not targeting WP you might try this trick with other projects as well, maybe it'll help...
Well, I'm glad it not just me cos I feel a bit crippled at the moment. Nor can I run my app on my iPhone either. No valid iOS code signing keys found in keychain
Beginning to wonder why I went down this Xamarin road.