on 12-04-2015 9:55 AM
hello all,
as you all know on a long running operation our beloved addins can stop because of this common error, and of course we all know how to solve the problem in a production environment. we only have to keep the addon alive with a timer.
my problem is debugging, i tried the solutions posted in many forum posts but none of them enables me to debug my addin and not to be stopped by this annoying interruption.
error that prevents us to work in a productive mood as we are alway interrupted by this exception and need to start our debugging session from the very beginning.
did you manage to avoid this mess while debugging? any sugegstion is aprpeciated
thnaks in advance.
fuell error:
Unable to cast COM object of type 'System.__ComObject' to interface type 'SAPbobsCOM.ICompany'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3BA8DAED-5B33-4CE4-A4B8-B4308D86E524}' failed due to the following error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)).
Hi Christian,
Couple of things I do:
Log instead of debug (when appropriate);
Isolate the application from B1 (also when appropriate);
Use filter conditions in breakpoints (instead of running through all iterations);
In the end none of them "fix" the "problem", but will help minimize it.
Cheers.
Best regards,
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks pedro.. we're already using those little helpful tricks..
but you know, when you're stuck in a breakpoint and have to run a couple of sql checks in enterprise manager.. you get back to visual studio, find the exception thrown and have to start over... well that's annoying..
i was trying to find a workaround.. it's a pain!
Hi Christian,
When dealing with queries you can use the Task.Run(() => delegate) this will make the whole task run in a different thread and free the UI. Makes it more responsive and as well prevents the dreaded RPC. You can check how to apply it in your case using the documentation on MSDN website.
Best regards,
Pedro Magueija
no pedro this is a misunderstanding.. i mean this:
when i debug and i'm in a breakpoint, i have to check some of the variables i'm watching against some data in our db. i switch from visual studio to sql enterprise manager and issue the sql queries i need to check the data in the app.. when i get bak and resume running the addon, well everything is broken, rpc sys somethin' error and i get to start over.
Hi Christian,
I understand, but if you are debugging inside the delegate, you are on another thread, meaning when you come back to the addon there will be no issues.
E.g.:
public void CallingMethod(SomeArgs args)
{
Task.Run(() => MyLongRunningMethod());
}
public void MyLongRunningMethod()
{
// some code to call SQL
// breakpoint in here
}
Because the calling method won't hold the calling thread (because your task is running on another thread) the UI can go on and keep doing its job (so no RPC).
When the long running method ends all that happens is that the other thread is returned to the pool and your task (query) is done.
Best regards,
Pedro Magueija
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.