Could not load type Microsoft.Office.Interop.Excel._Application

前端 未结 2 1617
盖世英雄少女心
盖世英雄少女心 2020-12-21 08:01

I\'m getting a error when I try to debug a code that reads Excel files. I\'m wondering if the reference to \'Microsoft.Office.Interop.Excel._Application\' is wrong, I get th

相关标签:
2条回答
  • 2020-12-21 08:18

    It sounds like you have a bad reference, not bad code. Has this code ever worked? Have you tried removing the reference to the Excel Interop and re-adding it again? Since it doesn't even get into your method, my assumption is that when the system tries to load the reference dll, it crashes.

    0 讨论(0)
  • 2020-12-21 08:23

    vcsjones commend got me on the correct track. after turning off Embedding Interop Assemblies I needed to edit the web.config to trust Excel

    <system.web>
        <trust level="Full" originUrl="" />
    
    0 讨论(0)
提交回复
热议问题