. NET Assembly reference COM component MSScriptControl problem solution, msscriptcontrol reference
Problem description:To execute the js script in C #, compile it on a target platform as Any Cpu. the MSScriptControl component is referenced in the. NET program. In the winform program, it is no problem to call the js execution method in the Assembly. However, an error is reported when calling windows Services. The error message is as follows:
After trying many methods, the solution still persists, including setting the reference attribute "embedded interoperability type" of the MSScriptControl component to false ,:
After this modification, another error is reported:
Solution:The MSScriptControl component is 32-bit. Therefore, you must set the target platform of the Assembly to the X86 platform. Set
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.