How to avoid a System.Runtime.InteropServices.COMException?

后端 未结 4 892
你的背包
你的背包 2020-11-29 07:56

In my Microsoft Surface project, I always get a lot of the following exceptions:

\'MuReSe.vshost.exe\' (Managed (v2.0.50727)): Loaded \'C:\\Windows\\assembly         


        
相关标签:
4条回答
  • 2020-11-29 08:40

    I came across System.Runtime.InteropServices.COMException while opening a project solution. Sometimes user doesn't have enough priveleges to run some COM Methods. I ran Visual Studio as Administrator and the exception was gone.

    0 讨论(0)
  • 2020-11-29 08:41

    I got this exception while coping a object(variable) Matrix Array into Excel sheet. The solution to this is, Matrix array Index(i,j) must start from (0,0) whereas Excel sheet should start with Matrix Array index (i,j) from (1,1) .

    I hope you this concept.

    0 讨论(0)
  • 2020-11-29 08:45

    Probably you are trying to access the excel with the index 0, please note that Excel rows/columns start from 1.

    0 讨论(0)
  • 2020-11-29 08:55

    Your code (or some code called by you) is making a call to a COM method which is returning an unknown value. If you can find that then you're half way there.

    You could try breaking when the exception is thrown. Go to Debug > Exceptions... and use the Find... option to locate System.Runtime.InteropServices.COMException. Tick the option to break when it's thrown and then debug your application.

    Hopefully it will break somewhere meaningful and you'll be able to trace back and find the source of the error.

    0 讨论(0)
提交回复
热议问题