Monday, May 9, 2016

Commerce Server Desktop Business Tools: Unsuccessful Attempt to Run on Mac OSX

I use .Net framework more than 10 years and long time ago wanted to try Mono. But, for web development it wasn't useful. Users see only frontend and does care what is under hood. Finally I have found task how I can try Mono: it is Commerce Server Desktop Business Tools.

Sitecore Commerce 8.1 powered by Commerce Server is shipped with two option of store management: Desktop Business Tools and Merchandising Manager. Merchandising Manager is SPEAK web application that allows to manage store from web application. Desktop Business Tools is set of Windows applications that also allows to manage store. Desktop Business Tools has much more features comparing Merchandising Manager. And if you have an option what to use I prefer Desktop Business Tools. Mac OSX users don't have such option(same for Linux users if someone uses Linux on desktop). But Desktop Business Tools are written majorly using .Net framework. What if we try to run them using Mono?

First of all you should forget about installer. You should install Desktop Business Tools on Windows machine and then copy all from C:\Program Files (x86)\Commerce Server 11 to your Mac. After copying and attempt to run 

sudo mono -v CatalogManager.exe

you will see that it requires additional assemblies, e.g. CommerceServer.Core.Catalog.dll. They could be added to Mogo GAC using gacutil (very similar as on Windows) or you should copy them from Commerce Server 11\Assemblies to Commerce Server 11\Business User Applications\bin. Trying to run again CatalogManager.exe via Mono again unsuccessful.  Commerce Server Business tools contains references to Windows unmanaged assemblies: msi.dll, kernel32.dll, user32.dll. You couldn't have them on Mac OSX.  But you could remove this references from code by changing Commerce Server Desktop Business Tools assemblies. Fortunately these reference are not related with business logic and you can replace with something that have similar logic or make stubs that return constants for some methods. Now we can see empty Catalog Manager window, but still get error: 



"System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) <0x2e486d8 + 0x0016b> in <filename unknown>:0 "

It is error in Mono itself so I stopped here. Google says that it is probably Mono bug. But Mono is cross-platform. Let's check if we can run Commerce Server Desktop Business Tools on Windows and Linux using Mono.

On Windows it works badly: there are a lot of appearance bugs and wizards don't work at all.

However you don't need to run it on Windows by Mono, here you have .Net framework.
On Ubuntu it works in a same way as on Windows, but probably looks a little bit better:


Conclusion: I managed to run Commerce Server Desktop Business Tools with Mono on Windows and Ubuntu. But as it was not designed to work on this platform it is very buggy. You can use it for management already existed content(everything that doesn't require wizards). For Mac OS I faced with Mono error, but I think that it is possible to run tools on Mac, probably you should try different Mono versions. And you always are able to setup Desktop Business Tools on Windows server and use RDP to it to manage anything in your store. It is much more better way!

P.S. I skipped few actions in description to make it faster:
  • Changing location of configuration files (there is no AppData folder on Mac or Linux)
  • Disabling tracing (it doesn't work)
And I don't recommend to use Commerce Server Desktop Business Tools anywhere except Windows platform. One thing that addition could be checked: how it is running under Wine? But it task for next time.

No comments:

Post a Comment