[MonoTouch] Best practice for leveraging existing C# library projects

Miljenko Cvjetko mcvjetko at holisticware.net
Tue Dec 6 07:14:58 EST 2011


Hi

Response inline:

On 2011.12.06 04:18, jlindborg wrote:
> So my rookie adventures continue…
>
> I have a large collection of C# library code for interacting with various
> servers (SOAP/REST/weird proprietary HTML/XML protocols you don’t want to
> know about) – I’d hoped since these are all strictly C# libraries with no UI
> elements and most are in 2.0 (some 3.5) that I could just import the
> projects from my snappy “Common” source folder where they sit and I could
> include them in my MonoTouch solutions all nice and tidy.  Living the
> code-reuse-cross-platform dream.
>
> Apparently that’s not the case.  Unless I’m missing something?  I’ve found
> various posts on forums and FAQ basically saying you need to manually copy
> files from your libraries into new projects – which makes me a little sad
> from an ongoing maintenance standpoint obviously (these libraries are in use
> on other Windows projects after all).
Do not copy files, rather link'em.... Use ProjectLinker - great stuff...
I have similar situation Core project with 300+ business-logic/model 
classes and utilities
written mostly for desktop apps (WF and WPF) in last 10 years.
Spent 3+ months (not 8hrs/day in total 40-60 hrs) splitting them across 
platforms
(mobile, RIA, desktop server-aspnet)...
Right now we have code base and can develop apps for

  * 3 mobile platforms
  * RIA silverlight
  * desktop WinForms, WPF
  * asp.net

Project linker in conjunction with some other VS tools can really make 
what you wish
a reality. I'm talking about VS tools because we are VS-centric and go 
over to Linux
or MacOS when majority of coding is done, just for UI and to see that 
solution is
not falling apart (supported/unsupported stuf: project types/APIs etc).

>
> It’s odd because I can bring the project into MonoDevelop’s solution for my
> example iPhone application and it does build (with a few bogus warnings) and
> seems happy, but when I try and import that project as a reference I get the
> dreaded “incompatible target framework” note.  As a test I took the files
> from a library, dumped them directly into my iPhone sample application,
> changed the namespace to match and presto, all worked dandy.
Do not reference them as assemblies, link the code...
>
> So is there some clean way to approach this without doing some ugly
> copy/past/manual maintenance nightmare?  Since one of the lead off pitches
> for this product is the code reuse story I’d have hoped this was a little
> more slick…
M4A and MT + MonoDevelop are very slick... Everything we do on VS side 
with Project
Linker opened/rebuilt in MD (with tiniy issues) on windows, then 
reopened/rebuilt
again on Linux and/or MacOS after cp/sm-share/svn-push-pull.

It simply works. Another advantage of source-code-linking is that You 
have to rebuild
projects after switch to MD and this gives You insight and relations 
about Mono and
.net especially with newer features.... And if there are any bugs You 
can send them to
Xamarin guys...

regards

mel
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/Best-practice-for-leveraging-existing-C-library-projects-tp4163295p4163295.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch


-- 
Miljenko Cvjetko dipl.ing. ET
	Direktor/CEO
	Projektant rješenja/Solution Architect	
	Razvojni programer/Senior developer
	Voditelj projekta/Project Manager

IX južna obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
w: http://www.holisticware.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111206/e06b6257/attachment-0001.html 


More information about the MonoTouch mailing list