vb.net error while registering evevents



Hi!,

I am developing a chat system using vb.net in vs 2005. I am getting
the following error while registering the events.

error details: System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See
Exception.InnerException for details. The error is: Type
System.DelegateSerializationHolder and the types derived from it (such
as System.DelegateSerializationHolder) are not permitted to be
deserialized at this security level."
Source="ChatApplication"
StackTrace:
at ChatApplication.My.MyProject.MyForms.Create__Instance__[T](T
Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at ChatApplication.My.MyProject.MyForms.get_Client()
at ChatApplication.Client.Main() in C:\tests\chatSol
\ChatApplication\Client.vb:line 8
at System.AppDomain.nExecuteAssembly(Assembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at Microsof

details:

'----------------------------------Client
Imports System.Runtime.Remoting.Channels.Http
Public Class Client
Inherits System.Windows.Forms.Form

Private theManager As InBetween.Manager

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()

Dim chan As HttpChannel = New HttpChannel("0")

System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(chan)

theManager =
CType(Activator.GetObject(Type.GetType("InBetween.Manager,InBetween"),
"http://localhost:7777/ChatApplication";), InBetween.Manager)

AddHandler Me.theManager.evtReceiveText, AddressOf
Me.HandleReceivedMsg

end sub
#End Region

Sub HandleReceivedMsg(ByVal username As String, ByVal text As
String)
Me.txtReceivedMsgs.AppendText(username & " : " & text &
vbCrLf)
End Sub

end class

'-------------------------------------Server
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Http
Imports System.Runtime.Remoting
Imports System
Imports InBetween

public class Server

Public Shared Sub Main()
Dim server1 As Server
server1 = New Server()
End Sub

Public Sub New()

Dim chan As IChannel = New HttpChannel(7777)

ChannelServices.RegisterChannel(chan)


System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType( _
Type.GetType("InBetween.Manager, InBetween"), _
"ChatApplication", WellKnownObjectMode.Singleton)

Dim Manager1 As New Manager()
Console.WriteLine("The Manager object's ID2:" &
Manager1.getHash())
System.Console.WriteLine("Hit ENTER to exit...")

System.Console.ReadLine()

End Sub

end class

'-------------------------------------Manager

Imports System

Public Delegate Sub ReceiveText(ByVal username As String, ByVal text
As String)

Public Class Manager
Inherits MarshalByRefObject

Public Event evtReceiveText As ReceiveText

Public Overrides Function InitializeLifetimeService() As Object
Return Nothing
End Function

Public Function SendText(ByVal username As String, ByVal text As
String)
RaiseEvent evtReceiveText(username, text)
End Function

End Class


Howerver, I can call the methods of remoting object.

Its very very urgent and I tried lot to resolve but i could not solve
this problem.

Please someone help me out and please suggest me if there are
alternative ways to resolve this.

Thanks.
Shivkumar S.

.



Relevant Pages

  • Re: problem with IListSource does not contain data source!!
    ... Imports System.Web.UI ... Private strSQLserver As String = "" ... Protected WithEvents grdNames As DataGrid ... Protected Overrides Sub CreateChildControls() ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: DataGrid-Inhalt in ein Picture wandeln?
    ... Imports System.Data ... Public Class Handler: Implements IHttpHandler ... Public Sub ProcessRequestImplements IHttpHandler.ProcessRequest ... Dim fnt As New Font(System.Drawing.FontFamily.GenericSansSerif, 12, ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: Using Httpwebrequest to Submit multipart/form-data
    ... > End Sub ... > Private Sub btnSignOn_Click(ByVal sender As System.Object, ... > Private Function PostRequest(ByVal strURL As String, ... > Public Class Parameters ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Using Httpwebrequest to Submit multipart/form-data
    ... > End Sub ... > Private Sub btnSignOn_Click(ByVal sender As System.Object, ... > Private Function PostRequest(ByVal strURL As String, ... > Public Class Parameters ...
    (microsoft.public.dotnet.framework)
  • Re: Using Httpwebrequest to Submit multipart/form-data
    ... > End Sub ... > Private Sub btnSignOn_Click(ByVal sender As System.Object, ... > Private Function PostRequest(ByVal strURL As String, ... > Public Class Parameters ...
    (microsoft.public.dotnet.general)