In our setup we do not have a DEFAULT market set up. When we try do add a new lineitem to a purchaseorder commerce manager crashes. When decompiling the dll:s and attached a pdb file we have found out that in Page_Load of ListPriceTemplate.cs that uses to this.Session["SelectedMarketSessionKey"] which is empty, and then it always defaults to DEFAULT market. But we have three other markets set up, and using the default market is wrong because the orders can ofcourse be in different markets.
Also, we have debugged MarketServiceCache (GetMarket method) and we can see that DEFAULT is passed in.
Does anyone know why SelectedMarketSessionKey is empty?
That seems to be a bug to me - I would suggest you to contact our support service and file a bug.
In the meanwhile, you can workaround by creating a class implements IMarketService and will return one of your market when DEFAULT market is requested. Then register your class as the implementation of IMarketService.