This post is really helpful. But still there are some hard code that is not satisfactory. The command
eval(['mcc -N -d ' dnetdir ' -W ''dotnet:dotnet,'
In this command, the parameter after the -W, which is 'dotnet:dotnet', is comprised of both a constant and a variable. The first one should always be 'dotnet', while the second one should be identical with the name of the dll, which is exactly the case in this example. When I change the dll name to some more meaningful name in my project, it reports the error... The work around is to just change the second 'dotnet' into whatever your dll name is. Hope this helps for some people. LOL