473,388 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

C# and VB6 Debugging

Hi,

I have a simple visual basic 6 program that calls a function in a class
written in C# assembly. Running executeable directly gives me no
problem, debugging VB6 program is also working fine. However, when I
try to debug C# assembly with VB6 program, VB6 program simply crashes
upon trying to create C# class object. I am attaching the VB6 and C#
sources for reference,

[C#]

using System;
using System.Windows.Forms;
namespace UsmanCSharp
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Class1
{
public Class1()
{
//
// TODO: Add constructor logic here
//
}

public void ShowMessage()
{
MessageBox.Show("Hello");
}
}
}

AssemblyInfo.cs ====>

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
[assembly: ClassInterface(ClassInterfaceType.AutoDual)]
[assembly: ComVisible(true)]

[VB6 Program]

Private Sub Command1_Click()
Dim a As UsmanCSharp.Class1

Set a = New UsmanCSharp.Class1

a.ShowMessage

End Sub

I have a machine running WinXP SP2 with VS.NET 2003(.NET Framework
v1.1.4322 and v 2.0.50727) and Microsft Visual Studio 6.0 (SP6)
installed. I registered C# assembly by RegAsm using following command,

regasm /tlb /codebase UsmanCSharp.dll

I had everything working fine till I got this new machine and debugging
in VS.NET stopped working. Any ideas what might be going on?

Thanks,
Usman

Feb 27 '06 #1
1 2177
This article might be of help.

http://www.vbrad.com/article.aspx?id=46
Usman wrote:
Hi,

I have a simple visual basic 6 program that calls a function in a class
written in C# assembly. Running executeable directly gives me no
problem, debugging VB6 program is also working fine. However, when I
try to debug C# assembly with VB6 program, VB6 program simply crashes
upon trying to create C# class object. I am attaching the VB6 and C#
sources for reference,

[C#]

using System;
using System.Windows.Forms;
namespace UsmanCSharp
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Class1
{
public Class1()
{
//
// TODO: Add constructor logic here
//
}

public void ShowMessage()
{
MessageBox.Show("Hello");
}
}
}

AssemblyInfo.cs ====>

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
[assembly: ClassInterface(ClassInterfaceType.AutoDual)]
[assembly: ComVisible(true)]

[VB6 Program]

Private Sub Command1_Click()
Dim a As UsmanCSharp.Class1

Set a = New UsmanCSharp.Class1

a.ShowMessage

End Sub

I have a machine running WinXP SP2 with VS.NET 2003(.NET Framework
v1.1.4322 and v 2.0.50727) and Microsft Visual Studio 6.0 (SP6)
installed. I registered C# assembly by RegAsm using following command,

regasm /tlb /codebase UsmanCSharp.dll

I had everything working fine till I got this new machine and debugging
in VS.NET stopped working. Any ideas what might be going on?

Thanks,
Usman

Feb 28 '06 #2

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

Similar topics

0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
2
by: Andy Fish | last post by:
Hi, Using VS.NET 2003, when I use 'F5' to start debugging my web app, it obviously attaches the IDE to IIS for server debugging. However, it also seems to put IE into some kind of debugging mode...
2
by: Alex Clark | last post by:
Hi All, My system: WinXP Pro, VS.NET 2003, SQL Server Personal Edition. I'm having problems with my old favourite demon, SQL Debugging from within VS.NET. I have to say I've found this...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
6
by: KevinGPO | last post by:
I am currently developing a website in ASP (VBScript) using MS Visual C#.NET IDE. I just create a new "ASP.NET Web Application" and point to my local webserver (IIS) of my website address. Then I...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
5
by: =?Utf-8?B?Z2FkeWE=?= | last post by:
I can't get to debug on my local IIS using VStudio.net 2005 Prof. I can on the development server. I get the msg 'the server does not support debugging for asp.net...' I have done the following...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
4
by: =?Utf-8?B?TWlrZSBHYWxl?= | last post by:
VS 2008 initially didn't debug classic ASP. SP1 fixes this in some ways. You can debug if you select the debug option to "Start Without Debugging, then either attach the debugger manually or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.