Link to home
Start Free TrialLog in
Avatar of shilpi2
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.PerformanceReport
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.getBenchmarkDollarsEarned_SingleDate_Object(ToDate, PortfolioMV, BenchmarkName)

but this line is never reached.  Nothing happens beyond the line
Set x = New IndexDailyPerformance.PerformanceReport

Please help!

Thanks

Shilpi
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Do you have the source code for the C# object included in your solution? You would need that to debug the C# call.
Avatar of shilpi2
shilpi2

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.
Avatar of shilpi2

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
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).
Avatar of shilpi2

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
ASKER CERTIFIED SOLUTION
Avatar of mrjoltcola
mrjoltcola
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial