A
Andreas =?ISO-8859-1?Q?M=FCller?=
Hi All,
I have the following situation:
Assembly VB defines a structure in VB.NET:
Public Structure TP
Public i As Integer
End Structure
Assembly CS (in C#) uses this structure and returns it from a function
CONV.exec() ). Additionally it defines a second test struct and a second
function to return the test struct:
public struct TST
{
public int i;
}
public class CONV
{
public static VB.TP exec()
{
VB.TP tp =new VB.TP();
tp.i=42;
return tp;
}
public static TST exec2()
{
TST tp =new TST();
tp.i=42;
return tp;
}
}
The assembly has a reference to assembly VB
Now the assembly VBCA (writen in VB) uses the C# assembly. It references
the VB and the C# assembly:
Sub Main()
Dim tst1 As VB.TP = CS.CONV.exec()'doesn't work, struct defined in VB
Dim tst2 As CS.TST = CS.CONV.exec2() 'works, struct defined in C#
End Sub
The compile of the first statement fails, when the Type is defined in a
VB assembly:
error BC30652: Reference required to assembly 'VB' containing the type
'VB.TP'. Add one to your project.
However, the second statement that uses a C# defined struct that is
absolutely identical to the VB one compiles and works.
Any ideas what is the culprit?
Thanks in advance,
Andy
I have the following situation:
Assembly VB defines a structure in VB.NET:
Public Structure TP
Public i As Integer
End Structure
Assembly CS (in C#) uses this structure and returns it from a function
CONV.exec() ). Additionally it defines a second test struct and a second
function to return the test struct:
public struct TST
{
public int i;
}
public class CONV
{
public static VB.TP exec()
{
VB.TP tp =new VB.TP();
tp.i=42;
return tp;
}
public static TST exec2()
{
TST tp =new TST();
tp.i=42;
return tp;
}
}
The assembly has a reference to assembly VB
Now the assembly VBCA (writen in VB) uses the C# assembly. It references
the VB and the C# assembly:
Sub Main()
Dim tst1 As VB.TP = CS.CONV.exec()'doesn't work, struct defined in VB
Dim tst2 As CS.TST = CS.CONV.exec2() 'works, struct defined in C#
End Sub
The compile of the first statement fails, when the Type is defined in a
VB assembly:
error BC30652: Reference required to assembly 'VB' containing the type
'VB.TP'. Add one to your project.
However, the second statement that uses a C# defined struct that is
absolutely identical to the VB one compiles and works.
Any ideas what is the culprit?
Thanks in advance,
Andy