0

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

9
  • 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# Commented 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 exception Commented 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. Commented Jul 8, 2018 at 5:44
  • This issue was resolved by moving a getter [Property] to the last position in the list of methods Commented 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 methods Commented Jul 9, 2018 at 8:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.