473,836 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to debug c# assemblies used in Delphi.Win32?

I am using a C# assembly in Delphi.Win32 using the com interop services.
This works fine, but I am looking for a way to debug the C# assembly. When
using a Delphi program as a host for the assembly, the program quits at the
point where it uses the assembly. If I start the Delphi program itself, all
works fine, but I can't debug the C# code.

Is there a way to have the Delphi debugger step into the C# assembly when
it's loaded? Or is there an alternative debugger that will help me with that?
Any help is appreciated.

Bye,
Bart Roozendaal
May 1 '06 #1
7 3158
Hi,

What if you use a C# program to make the same calls (methods & parameters)
than you do from Delphi?

You can attach the debug to anther process. go to Debug/Processes and
select the process you want (from the .dll IDE ) , additionally you could
compile the external program and set it as the starting program fomr the
Project/Properties menu. I use this technique when I'm programming GIS code
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
I am using a C# assembly in Delphi.Win32 using the com interop services.
This works fine, but I am looking for a way to debug the C# assembly. When
using a Delphi program as a host for the assembly, the program quits at the
point where it uses the assembly. If I start the Delphi program itself, all
works fine, but I can't debug the C# code.

Is there a way to have the Delphi debugger step into the C# assembly when
it's loaded? Or is there an alternative debugger that will help me with
that? Any help is appreciated.

Bye,
Bart Roozendaal

May 1 '06 #2
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT dot.state.fl.us ,

Thanks for answering me. I tried both attaching to the running process (gives
an error: cannot attach to this process or similar) as well as using the
Delphi program as a startup program (which causes the program to quit immediately
when calling the assembly. I haven't tried using a C# calling program as
I will assume that will work fine. The code in itself looks ok, it's just
that I want to have a decent way of debugging...

Any other suggestion you might have is much appreciated.
bart
Hi,

What if you use a C# program to make the same calls (methods &
parameters) than you do from Delphi?

You can attach the debug to anther process. go to Debug/Processes and
select the process you want (from the .dll IDE ) , additionally you
could compile the external program and set it as the starting program
fomr the Project/Properties menu. I use this technique when I'm
programming GIS code

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
I am using a C# assembly in Delphi.Win32 using the com interop
services. This works fine, but I am looking for a way to debug the C#
assembly. When using a Delphi program as a host for the assembly, the
program quits at the point where it uses the assembly. If I start the
Delphi program itself, all works fine, but I can't debug the C# code.

Is there a way to have the Delphi debugger step into the C# assembly
when it's loaded? Or is there an alternative debugger that will help
me with that? Any help is appreciated.

Bye,
Bart Roozendaal

May 1 '06 #3
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT dot.state.fl.us ,

FWIW: I now tried using the assembly from a X# host program and debugging
just works fine there...
Hi,

What if you use a C# program to make the same calls (methods &
parameters) than you do from Delphi?

You can attach the debug to anther process. go to Debug/Processes and
select the process you want (from the .dll IDE ) , additionally you
could compile the external program and set it as the starting program
fomr the Project/Properties menu. I use this technique when I'm
programming GIS code

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
I am using a C# assembly in Delphi.Win32 using the com interop
services. This works fine, but I am looking for a way to debug the C#
assembly. When using a Delphi program as a host for the assembly, the
program quits at the point where it uses the assembly. If I start the
Delphi program itself, all works fine, but I can't debug the C# code.

Is there a way to have the Delphi debugger step into the C# assembly
when it's loaded? Or is there an alternative debugger that will help
me with that? Any help is appreciated.

Bye,
Bart Roozendaal

May 1 '06 #4
Hi,

Are you exporting it as a COM ?

If the code works fine then it's an issue with the COM visibility from
Delphi. How are you doing it?

There is a checkmark in Project/Settings that reads as "Register for COM
interop", make sure it's marked
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT dot.state.fl.us ,

Thanks for answering me. I tried both attaching to the running process
(gives an error: cannot attach to this process or similar) as well as
using the Delphi program as a startup program (which causes the program to
quit immediately when calling the assembly. I haven't tried using a C#
calling program as I will assume that will work fine. The code in itself
looks ok, it's just that I want to have a decent way of debugging...

Any other suggestion you might have is much appreciated.
bart
Hi,

What if you use a C# program to make the same calls (methods &
parameters) than you do from Delphi?

You can attach the debug to anther process. go to Debug/Processes and
select the process you want (from the .dll IDE ) , additionally you
could compile the external program and set it as the starting program
fomr the Project/Properties menu. I use this technique when I'm
programming GIS code

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
I am using a C# assembly in Delphi.Win32 using the com interop
services. This works fine, but I am looking for a way to debug the C#
assembly. When using a Delphi program as a host for the assembly, the
program quits at the point where it uses the assembly. If I start the
Delphi program itself, all works fine, but I can't debug the C# code.

Is there a way to have the Delphi debugger step into the C# assembly
when it's loaded? Or is there an alternative debugger that will help
me with that? Any help is appreciated.

Bye,
Bart Roozendaal


May 1 '06 #5
Hi,

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT dot.state.fl.us ,

FWIW: I now tried using the assembly from a X# host program and debugging
just works fine there...


Are you registering your dll for COM interop?
May 1 '06 #6
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT dot.state.fl.us ,

Hi Ignacio, see other answer, but yes, I do...
Hi,

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT
dot.state.fl.us ,

FWIW: I now tried using the assembly from a X# host program and
debugging just works fine there...

Are you registering your dll for COM interop?

May 1 '06 #7
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT dot.state.fl.us ,

I'm using BDS2006: there is no Project-Settings option, just Project-Options.
In the Options there is no 'Register for COM interop'. I used regasm to generate
a tlb, which I imported in the Delphi program.

In the help files, the only reference I can find to the 'Register for COM
Interop' setting is in a Visual Basic.NET example and a V# description. In
the assemblyinfo I have added the [assembly: ComVisible(true )] setting.

Does this help you?

Bye,
Bart
Hi,

Are you exporting it as a COM ?

If the code works fine then it's an issue with the COM visibility from
Delphi. How are you doing it?

There is a checkmark in Project/Settings that reads as "Register for
COM interop", make sure it's marked

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
Hello Ignacio Machin ( .NET/ C# MVP )" ignacio.machin AT
dot.state.fl.us ,

Thanks for answering me. I tried both attaching to the running
process (gives an error: cannot attach to this process or similar) as
well as using the Delphi program as a startup program (which causes
the program to quit immediately when calling the assembly. I haven't
tried using a C# calling program as I will assume that will work
fine. The code in itself looks ok, it's just that I want to have a
decent way of debugging...

Any other suggestion you might have is much appreciated. bart
Hi,

What if you use a C# program to make the same calls (methods &
parameters) than you do from Delphi?

You can attach the debug to anther process. go to Debug/Processes
and select the process you want (from the .dll IDE ) , additionally
you could compile the external program and set it as the starting
program fomr the Project/Properties menu. I use this technique when
I'm programming GIS code

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...

I am using a C# assembly in Delphi.Win32 using the com interop
services. This works fine, but I am looking for a way to debug the
C# assembly. When using a Delphi program as a host for the
assembly, the program quits at the point where it uses the
assembly. If I start the Delphi program itself, all works fine, but
I can't debug the C# code.

Is there a way to have the Delphi debugger step into the C#
assembly when it's loaded? Or is there an alternative debugger that
will help me with that? Any help is appreciated.

Bye,
Bart Roozendaal

May 1 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
3066
by: glenn | last post by:
I've gotten a COM server written in C# and I can call it from a VBScript just fine and it works perfectly. However, I import it into Delphi 6 or Delphi 2005 and I can not get access to any of the functions that are in the server. Is there something specific that I need to do in order to get Delphi to see the functions that are a part of the server? Thanks, glenn
13
2082
by: lukeharpin | last post by:
Hi World, We have been developing Engineering software in Delphi 3,4,5,6,7 for a few years now. This morning we had a discussion about OOP and re-programming the software to which the question came up, should we stay with Delphi and go with Delphi 2005 or not. I'm interested to here everyone's opinion. Here were a few points raised. Is the future .net and will every one have .net in 2 years time. Will Delphi be around in 5 years time....
7
3200
by: Sunil Varma | last post by:
Hello all, I wrote a Windows Service in VC.NET 2005 I want to debug the solution. I tried as mentioned in the following link. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp But, when I started the service I got a message box saying that the service is being stopped.
7
4014
by: MB | last post by:
I had a C++ dll that I used for C++ applications. I added a managed C++ class to this library and started to use the managed C++ class in my C# application. This works OK only if I build the C++ dll in release mode. If I try to build the C++ dll in Debug mode, I am unable to add the dll as a reference to my C# project. I get an error message that: "This is not a valid assembly or COM component".
3
4254
by: Bardo | last post by:
Hi all, We are trying to debug an assembly which was built in debug configuration on our build server. The output window of visual studio indicates that no symbols are being loaded for the assembly. However, when the PDB file is copied alongside the dll, the symbols load ok. We were a little confused, because we had already been debugging this assembly WITHOUT copying the pdb file. What I discovered was that when the assembly is built...
6
9147
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++ project. I then add a class library, and add a reference to this project in the first project. When I do a release build, I see the following in the output from the DLL compile: /OUT:"C:\Documents and Settings\Andrew\My Documents\Visual Studio
4
4104
by: =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post by:
Dear List, We have a large application written in Delphi. I am writing a mobile app written in .NET (C#) which reads and writes into the Delphi applications Oracle database via a .NET Web Service. Much of the data centred functionality on the application is quite involved, and to re-write all this functionality in the .NET web service would be very time consuming. Our idea is to perhaps develop a DLL written in Delphi, which copies...
6
2389
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi there We are trying to build a C sharp solution in Visual Studio 2005 Professional. We have a number of other assemblies, that do not form part of the solution. Assemblies that do form part of the solution have been referenced using the Projects tab in the Add Reference dialog. Assemblies that do not form part of the solution have been added usingthe
3
3382
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components using Debug mode. Now we are ready to compile everything for release to production. However, we don’t know whether we should compile all the applications/components/assemblies using Release mode (or keep everything in Debug mode). We’ve...
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10526
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10570
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10240
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5811
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3100
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.