1

This one is weird. I've got a MonoDevelop/MonoTouch project (call it MyApp) that references another project (call it MyUtils), which is a Portable Class Library (targeting .NET 4.0.3, if that is relevant).

In the MyApp project, I've added a reference to MyUtils. In Visual Studio, this works properly: I can refer to the classes in MyUtils without any problem.

But in MonoDevelop on the Mac, if I try to refer to MyUtils from MyApp, I can't. It simply doesn't see the project, and can't, for instance, write something like:

using MyUtils.MyNamespace

If I do, I get a 'type or namespace could not be found' error.

But here's the weird part: MyApp can use the static classes in MyUtils. If I refer to a public static class in MyUtils from MyApp, it works! What could possibly explain this?!

Joshua Frank
  • 13,120
  • 11
  • 46
  • 95

1 Answers1

4

What explains this is that the MonoTouch implementation of PCLs is a bit of a kludge at present.

The proper work is underway, but in the meantime you need to use an interim release of MonoDevelop, and you need to be aware that things like Intellisense and syntax highlighting don't really work in MonoDevelop.

See:


Update - the interim release is hidden in a comment on that question:

For those doing PCL stuff, I've posted a patched MonoDevelop 3.1.1 build with improved PCL support here: http://files.xamarin.com/~jeff/MonoDevelop-3.1.1.dmg - it's still not perfect, but it's better than the official builds so far (my patches will be in a future official release) – jstedfast Feb 8 at 14:57

Community
  • 1
  • 1
Stuart
  • 66,722
  • 7
  • 114
  • 165
  • Thank you for this! Trying now to get this working. When you say "Intellisense and syntax highlighting don't really work", do you have any sense of what is and isn't reliable? In my coding so far, they do appear to work for static classes, as noted in the question, but not anything else. In other words, when I can see the referenced project at all, the IDE support does work. – Joshua Frank Feb 13 '13 at 11:32
  • :-( I installed that interim release but it doesn't seem to address the problem. I can still see static classes in the PCL library but I still CANNOT refer to the library by namespace. Is there any other configuration I need to do here? – Joshua Frank Feb 13 '13 at 12:14