C
CaffieneRush
Hi,
TypeForwardedToApp is one of the attributes covered in the MS upgrade
exam 70-553 http://www.microsoft.com/learning/exams/70-553.asp.
I've tried to code a short example in vb.net to test my understanding
of the attribute.
Unfortunetely, I could not get the attribute to work in vb.net (program
throws a TypeLoadException).
What's strange is that the c# examples using the same driver do work.
I wonder if anyone here has managed to get the TypeForwardedToApp
attribute to work in vb.net? Or perhaps knows what I'm doing wrong in
the vb.net examples.
Regards,
Andy
---
Module1.vb
---
Imports MyNamespace
'The test driver
Namespace TypeForwardedTo
Module Module1
Sub Main()
Dim c As New Class1
End Sub
End Module
End Namespace
---
Class1.vb in ClassLibrary1VB assembly
---
<Assembly:
System.Runtime.CompilerServices.TypeForwardedTo(GetType(MyNamespace.Class1))>
Namespace MyNamespace
'In ClassLibrary1VB assembly
'Public Class Class1
' Public Sub New()
' Console.WriteLine("In ClassLibrary1VB assembly")
' End Sub
'End Class
End Namespace
---
Class1.vb in ClassLibrary2VB assembly
---
Namespace MyNamespace
Public Class Class1
Public Sub New()
Console.WriteLine("In ClassLibrary2VB assembly")
End Sub
End Class
End Namespace
---
Class1.cs in ClassLibrary1CS assembly
---
[assembly:
System.Runtime.CompilerServices.TypeForwardedTo(typeof(MyNamespace.Class1))
]
//using System;
//using System.Collections.Generic;
//using System.Text;
namespace MyNamespace
{
//public class Class1
//{
// public Class1()
// {
// Console.WriteLine("In the ClassLibrary1CS assembly");
// }
//}
}
---
Class1.cs in ClassLibrary2CS assembly
---
using System;
using System.Collections.Generic;
using System.Text;
namespace MyNamespace
{
public class Class1
{
public Class1()
{
Console.WriteLine("In the ClassLibrary2CS assembly");
}
}
}
TypeForwardedToApp is one of the attributes covered in the MS upgrade
exam 70-553 http://www.microsoft.com/learning/exams/70-553.asp.
I've tried to code a short example in vb.net to test my understanding
of the attribute.
Unfortunetely, I could not get the attribute to work in vb.net (program
throws a TypeLoadException).
What's strange is that the c# examples using the same driver do work.
I wonder if anyone here has managed to get the TypeForwardedToApp
attribute to work in vb.net? Or perhaps knows what I'm doing wrong in
the vb.net examples.
Regards,
Andy
---
Module1.vb
---
Imports MyNamespace
'The test driver
Namespace TypeForwardedTo
Module Module1
Sub Main()
Dim c As New Class1
End Sub
End Module
End Namespace
---
Class1.vb in ClassLibrary1VB assembly
---
<Assembly:
System.Runtime.CompilerServices.TypeForwardedTo(GetType(MyNamespace.Class1))>
Namespace MyNamespace
'In ClassLibrary1VB assembly
'Public Class Class1
' Public Sub New()
' Console.WriteLine("In ClassLibrary1VB assembly")
' End Sub
'End Class
End Namespace
---
Class1.vb in ClassLibrary2VB assembly
---
Namespace MyNamespace
Public Class Class1
Public Sub New()
Console.WriteLine("In ClassLibrary2VB assembly")
End Sub
End Class
End Namespace
---
Class1.cs in ClassLibrary1CS assembly
---
[assembly:
System.Runtime.CompilerServices.TypeForwardedTo(typeof(MyNamespace.Class1))
]
//using System;
//using System.Collections.Generic;
//using System.Text;
namespace MyNamespace
{
//public class Class1
//{
// public Class1()
// {
// Console.WriteLine("In the ClassLibrary1CS assembly");
// }
//}
}
---
Class1.cs in ClassLibrary2CS assembly
---
using System;
using System.Collections.Generic;
using System.Text;
namespace MyNamespace
{
public class Class1
{
public Class1()
{
Console.WriteLine("In the ClassLibrary2CS assembly");
}
}
}