1

I am trying out Prism7 together with AutoFac in a xamarinforms project. I am trying to create a custom renderer for an entry control, nothing fancy here. But for some reason i cannot get a reference to xamarin.forms and xamarin.forms.platform.ios/android namespaces in my ios and android project.

The project is based on the prism7 templates and the pcl is a .net 2.0

Normally I would expect

[assembly: ExportRenderer(typeof(Entry), typeof(BorderlessEntryRenderer))]

to work and connect my renderers but as said cannot reference xamarin.forms.

Anyone got an ideer?

2 Answers2

0

I made it work. Solution was to open project in Visual Studio Mac (I was in pc version before). Then there is no problem seeing the namespaces. Rebuild and run both projects to see them work.

Go back to visual studio pc version and continue work there. If you have Resharper you need to clear cache otherwise it will look like you still have errors.

Must be a Visual Studio Pc or Resharper bug. Maybe I should use Mac version from now on :-)

0

I had the same problem. That's how I fixed it:

  • Add the correct references (ex: using myproject.myrenderers;)
  • Close the solution and Visual Studio (Windows).
  • Delete all bin and obj folders in the solution (including each platform).
  • Open VS and the project.
  • Clean.
  • Rebuild.

Done.

Dpedrinha
  • 3,741
  • 3
  • 38
  • 57