It's my fault. I put it in the beginning of script.

If I put the line in function main(), the dll load successfully.