call to c sharp from visual basic

shilpi2
shilpi2 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Shaun KlineLead Software Engineer

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

Author

Commented:
how do i check for this?
Top Expert 2009

Commented:
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.
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Author

Commented:
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
Top Expert 2009

Commented:
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).

Author

Commented:
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
Top Expert 2009
Commented:
Hmm, sounds like you may be experiencing an issue with trust level / .NET security.

http://support.microsoft.com/kb/832742

Why do you reference the dll from a network drive anyway? Just move it to your project, and build / distribute with your app and that will resolve things.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial