I had a working C# [DOT NET 4.6.1] project which used COM interfaces. After I added two methods to an interface, I started getting the exception "The procedure number is out of range. (Exception from HRESULT: 0x800706D1)" . This has never happened previously, and I have always been able to change COM interfaces and classes without any issues. I found the following in MSDN support at https://msdn.microsoft.com/en-us/library/ms838933.aspx "Contact the supplier of the running distributed application. There is a version control problem in the application that can only be fixed by the application supplier (procedures were added to an .IDL file without changing the version number)." I tried changing the GUID of the interface, but then the I got a cast exception when trying to use the object , saying no such interface supported. Is this a VS2017 issue (Compile does not update the build)or is it something else? Please help! Sagar
I get a COM exception after adding methods to a COM Interface [The procedure number is out of range]
-
Perhaps these articles will be helpful. How can I add functionality to COM object in c#?, C# exposing to COM - interface inheritance, Interface inheritance in ComVisible classes in C#kunif– kunif2018-07-07 23:52:01 +00:00Commented Jul 7, 2018 at 23:52
-
Kunif, Perhaps my question was not clear enough. I dont have problems with adding COM functionality as such. The problem is that after adding two methods to an interface, and then attempting to call those methods leads to the above exceptionSagar Kapadia– Sagar Kapadia2018-07-08 05:22:59 +00:00Commented Jul 8, 2018 at 5:22
-
Maybe the TypeLib information is outdated, and it is old information before expansion? Please recreate the TypeLib information again from C # dll, register it again with regasm.exe, or re-execute all steps executed with the previous C # dll.kunif– kunif2018-07-08 05:44:24 +00:00Commented Jul 8, 2018 at 5:44
-
This issue was resolved by moving a getter [Property] to the last position in the list of methodsSagar Kapadia– Sagar Kapadia2018-07-08 05:58:16 +00:00Commented Jul 8, 2018 at 5:58
-
Kunif, I tried creating the tlb file using regasm /tlb, but it did not help. The only thing that worked was moving the getter/property to the last position in the list of methodsSagar Kapadia– Sagar Kapadia2018-07-09 08:25:23 +00:00Commented Jul 9, 2018 at 8:25
|
Show 4 more comments