VB6 and VS.NET 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

.



Relevant Pages

  • VB6 and VS.NET debugging
    ... debugging VB6 program is also working fine. ... /// Summary description for Class1. ... regasm /tlb /codebase UsmanCSharp.dll ... I had everything working fine till I got this new machine and debugging ...
    (microsoft.public.vsnet.debugging)
  • C# and VB6 Debugging
    ... debugging VB6 program is also working fine. ... /// Summary description for Class1. ... regasm /tlb /codebase UsmanCSharp.dll ... I had everything working fine till I got this new machine and debugging ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# and VB6 Debugging
    ... debugging VB6 program is also working fine. ... /// Summary description for Class1. ... I have a machine running WinXP SP2 with VS.NET 2003(.NET Framework ... regasm /tlb /codebase UsmanCSharp.dll ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Jit Debugging - COM Interop
    ... I still think the app.config here for your two class libraries are not ... related to the debugging from Visual Studio. ... to VB6 program, the VB6 program hasn't loaded CLR yet. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Access a VB.net ComClass from VB6
    ... Did you register the component using RegAsm? ... I initially registered it using RegAsm but after that everytime I ... vb6 program. ... I downloaded a sample app from msdn site and it worked and it did have ...
    (microsoft.public.vb.com)