I am testing out Xamarin.Android via Visual Studio 2010.
My Xamarin.Android VS2010 Solution contains two projects: The Android project and a project (I'll call it MyProject for this post) that does all the business logic for the demo app that I'm making - The Android project references the MyProject project/assembly).
When I run the appliation, I am receiving an exception error in MyProject and, so, I would like to step into MyProject and debug the problem.
However, when I debug, VS2010 is not stepping into MyProject.
For example:
In my Android project I have a breakpoint at the location of the exception:
MyProject mp= new MyProject();
mp.DoSomething(); // Exception is thrown here, breakpoint is set here, but VS doesn't step into the MyProject code. The debugger gets stuck here and displays exception info in the Output window.
What do I need to do to debug a referenced project/assembly in my VS2010 Mono Android project?
The reason I was unable to debug the referenced assembly was due to the fact that my referenced assembly was a .NET assembly - an assembly written in C# which referenced .NET assemblies.
Being new to Xamarin.Android development, I assumed that I could create an Android project and then simply reference an existing .NET project to the Android project - this is not the case.
In order to reference a .NET assembly in an Android project (and thereby debug the .NET assembly) I had to:
System.Data
assembly.The important thing to understand (which I didn't) is that Xamarin has created Mono assemblies which correspond to the .NET assemblies. The Mono assemblies exist (on my machine) in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\
while the .NET assemblies exist (on my machine) in '(i.e. assemblies found within the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
directory)'.
On that note - If an Android project is referencing an assembly/project that uses the .NET assemblies, you will receive a Warning that states
"The project 'MyProject' cannot be referenced. The referenced project is targeted to a different framework family (.NETFramework)"