
{"id":90,"date":"2014-09-15T10:43:05","date_gmt":"2014-09-15T10:43:05","guid":{"rendered":"http:\/\/www.codergears.com\/Blog\/?p=90"},"modified":"2014-11-08T16:33:43","modified_gmt":"2014-11-08T16:33:43","slug":"feedbacks-on-porting-net-code-base-to-mac-osx","status":"publish","type":"post","link":"https:\/\/codergears.com\/Blog\/?p=90","title":{"rendered":"Feedback on porting .Net code base to Mac OSX"},"content":{"rendered":"<p>Few years ago, after releasing the <a href=\"http:\/\/www.cppdepend.com\/\">CppDepend <\/a> product, many users ask us for a Mac OSX version to analyze the Objective C code base, last year we decided to develop <a href=\"http:\/\/www.codergears.com\/XClarify\/\">XClarify<\/a>, the CppDepend like for Objective C.<\/p>\n<p>Our GUI was developed using .Net and porting all the code to Objective C has the big drawback to maintain two versions, time for our \u00a0developement team to make some research on how to reuse our .Net code for the Mac OSX version?<\/p>\n<p><strong>What&#8217;s the solution to port a .Net code base to Mac OSX?<br \/>\n<\/strong><br \/>\nWhen searching for all possiblities, the trivial one was to use <a href=\"http:\/\/www.mono-project.com\/\">Mono<\/a>, it wasn&#8217;t an easy task, specially because we use DevExpress which is not compliant with Mono due to the overuse of P\/Invoke calls.<\/p>\n<p>In our first version we used the Mono Winforms implementation to avoid big changes on our code base, and we finally released our beta version. After contacting some Objective C developers to give XClarify a try, we discoverd our big mistake, and here are some feedbacks from Mac OSX users:<\/p>\n<blockquote><p>Having an application that looks like Visual Studio on OS X is enough of an insult.<\/p><\/blockquote>\n<blockquote><p>I&#8217;ve downloaded your product for the trial but when I&#8217;m trying to run it it is asking for X11. I&#8217;ve read a couple of things on line that says that installing this X11 over Apples could cause instabilities &#8211; what are the risks in doing this and why is it needed?<\/p><\/blockquote>\n<p>Thanks to beta users we were warned about the biggest mistake we have done and time for us to quickly find another solution to correct this, so how to make a product that meets the Mac OSX users requirements?<\/p>\n<p>The solution was to use the cocoa framework, and fortunately a cocoa porting to Mono is provided by <a href=\"http:\/\/xamarin.com\">Xamarin<\/a> which offers the <a href=\"http:\/\/www.mono-project.com\/docs\/tools+libraries\/libraries\/monomac\/\">MonoMac<\/a> library, but using MonoMac will impact all the Gui code base, and we can&#8217;t have anymore one codebase to maitain. but we learned well the lesson, <strong>what&#8217;s more important is not to have one code base to maitain but what the user is waiting for when he uses the product.<\/strong><\/p>\n<p>We decided for our second version to use MonoMac and remove all dependencies with System.Windows.Forms and System.Drawing libraries to use Cocoa instead.<\/p>\n<p>Concerning removing the dependency with System.Drawing, there&#8217;s the following <a href=\"https:\/\/github.com\/mono\/sysdrawing-coregraphics\">library<\/a>, but it&#8217;s not mature yet, and some blocking bugs will encourage you to not using it.<\/p>\n<p>To make the porting easier, we needed a good Gui library which simplify the Gui developement, and we found a powerful library, named <a href=\"https:\/\/github.com\/picoe\/Eto\">Eto<\/a>. Its developement team is very active and the library is stable.<\/p>\n<p>After releasing our second version, we had to package the product to a standalone application which must be easy to install without installing other requirements. The MonoMac library is not sufficient for that and you have to use Xam.Mac which is not free.<\/p>\n<p>As conclusion if you want to port your .Net application to Mac OSX, an interesting solution is to use <a href=\"http:\/\/xamarin.com\/studio\">Xamarin Studio<\/a>, Xam.Mac and Eto libraries, and especially avoid using System.Windows.forms.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few years ago, after releasing the CppDepend product, many users ask us for a Mac OSX version to analyze the Objective C code base, last year we decided to develop XClarify, the CppDepend like for Objective C. Our GUI was developed using .Net and porting all the code to Objective C has the big drawback &hellip; <a href=\"https:\/\/codergears.com\/Blog\/?p=90\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Feedback on porting .Net code base to Mac OSX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=90"}],"version-history":[{"count":23,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":650,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/90\/revisions\/650"}],"wp:attachment":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}