C# and VB6 Debugging

U

Usman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top