shilpi2
asked on
call to c sharp from visual basic
Hi Experts,
I am absolutely new with C sharp. I am working on code in an existing system. The visual basic code is giving call to a c sharp code as follows:
Set x = New IndexDailyPerformance.Perf ormanceRep ort
when i debug in visual basic the control does not go past this line . I have no idea what is going on. I have also selected the option for debugging c sharp from visual basic. The control should go to c sharp when the following line is reached in visual basic
testArray = x.getBenchmarkDollarsEarne d_SingleDa te_Object( ToDate, PortfolioMV, BenchmarkName)
but this line is never reached. Â Nothing happens beyond the line
Set x = New IndexDailyPerformance.Perf ormanceRep ort
Please help!
Thanks
Shilpi
I am absolutely new with C sharp. I am working on code in an existing system. The visual basic code is giving call to a c sharp code as follows:
Set x = New IndexDailyPerformance.Perf
when i debug in visual basic the control does not go past this line . I have no idea what is going on. I have also selected the option for debugging c sharp from visual basic. The control should go to c sharp when the following line is reached in visual basic
testArray = x.getBenchmarkDollarsEarne
but this line is never reached. Â Nothing happens beyond the line
Set x = New IndexDailyPerformance.Perf
Please help!
Thanks
Shilpi
Do you have the source code for the C# object included in your solution? You would need that to debug the C# call.
ASKER
how do i check for this?
Click on the function or identifier that you want to drill down into and then right-click and choose "Go to Definition". If it opens a metadata only file, then the source code is not visible, and you are referencing a dll and need to go find the project of the dll, or you don't have the dll due to it being a 3rd party dll.
I also suggest a commercial add-in tool like Visual Assist (whole tomato software) that lets you browse source easier (ctrl-click lets you drill down to definitions quickly).
Also make sure you are building in Debug mode, and try F11 (trace into) at that line.
I also suggest a commercial add-in tool like Visual Assist (whole tomato software) that lets you browse source easier (ctrl-click lets you drill down to definitions quickly).
Also make sure you are building in Debug mode, and try F11 (trace into) at that line.
ASKER
Hi,
I did the sake Mrjoltcola. I clicked on the definition and then i saw the reference which is set correctly. However, during the code execution something is going wrong with that reference. No idea!
Shilpi
I did the sake Mrjoltcola. I clicked on the definition and then i saw the reference which is set correctly. However, during the code execution something is going wrong with that reference. No idea!
Shilpi
Add a try/catch block around the statement. Possibly an exception is being thrown, and you can find out what it is by catching it (with a breakpoint in the exception handler).
ASKER
When I click on Tools->references in Visual Basic I get 2 dll's - One is S drive and the other in C drive. I want it to fetch DLL from S drive but when I select the dll from S drive it does not work. Whereas if I select dll from C drive it works but sometimes. I do not know what is happening.
thanks
Shilpi
thanks
Shilpi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.