Trouble initializing libraries required by .NET Assembly

I have a trouble when I generated a type-safe api dll's of magic square function which is just:
function m = mymagic(n)
m=magic(n);
On my PC (x64 i7 windows 8.1 with matlab r2016a and MCR 901 not a server) everything works fine.
but on my server (x64 Intel® Xeon® Processor E5-2670 windows server 2012 r2 with matlab r2016a and mcr901) with the same works has done simultaneusly with my home PC throws an exception
Exception is:
(1st)System.TypeInitializationException
(Inner Ex 1) The type initializer for 'mymagicNative.Magicing' threw an exception.
(Inner Ex 2) The type initializer for 'MathWorks.MATLAB.NET.Utility.MWMCR' threw an exception.
(Inner Exception 3) Trouble initializing libraries required by .NET Assembly.
I need to solve this issue for my graduation of my licence program at university. Any other information you need will be posted. Any helps will be appreciated. Thank you.
Attachments:
2nd attachment:
Edit: I've checked most of the solutions described in matlabcentral and stackoverflow (by googling these exceptions above) before I post this question but no success acquired

Asked:

on 13 Apr 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!