473,416 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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__Insta nce__[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.R egisterChannel(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.Regi sterWellKnownServiceType( _
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.

Jul 17 '07 #1
1 2168
sh***********@gmail.com wrote:
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."
Remoting supports two "security levels" which controls the kinds of
objects that you can send across the "Great .Net Remoting Divide".
It sounds to me like you're running at the "lower" level, which only
supports basic, Framework-implemented types. You need to tell the
remoting server to use the "higher" one, so that you can serialise your
own Types as well.

I don't know which property it would be, but in the remoting
configuration file (which I use; I'm lazy) it would be specified as:
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" port="12345">
<serverProviders>
<formatter
ref="binary"
typeFilterLevel="Full" <-- this one!
/>
. . .

HTH,
Phill W.
Jul 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Snake Djip | last post by:
Hi, I have a problem with a home-made DLL used in an ASP environment. It is coded in VB6, apartment-threaded. The DLL returns a binary PNG stream (an image). I use it with ASP's...
0
by: Boomessh | last post by:
Hai all, can any one help me in solving he following problem? I am registering a COM+ component in a machine. While registering i am getting the following error. ...
1
by: Paul T. Rong | last post by:
I can not understand why the message appears everytime when I install the packed app (using 2k PDW) "error while registering C:\WINDOWS\SYSTEM\MSADO21.TLB"(I don't remember exactly what it says),...
2
by: glenn | last post by:
I have written a COM Server in C# and its working perfectly. I am not ready to deploy to client computers to begin the real testing and am now wondering how to perform. The part that confuses me...
5
by: Rich | last post by:
I loaded visual studio.Net 2003 on a windows XP workstation, and I was able to run aspx applications. Later I loaded JBuilder 2005 (Enterprise Java builder 2005) which runs the Tomcat 5.0 web...
0
by: David Davis | last post by:
I am setting up some collaboration software called eProject for a client. eProject is a web based asp application. During setup, the instructions called for registering a service called...
1
by: sonajain | last post by:
Hi, My ASP application is calling dlls I am able to register the dlls properly. While registering the dlls it doesnt give any error. but application is not able to use that dlls. I called same dlls...
0
by: shivkumar2004 | last post by:
Hi, I m getting the following error while registering the events on client appl. error: "An error occurred creating the form. See Exception.InnerException for details. The error is: Exception...
12
by: henrymania | last post by:
hi, I am developing a web services in netbeans 5.5.1 and using sun application server as my container . i was able to run the application once....i mean i was able to see my servlet...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.