473,785 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.InvalidO perationExcepti on was unhandled
Message="An error occurred creating the form. See
Exception.Inner Exception for details. The error is: Type
System.Delegate SerializationHo lder and the types derived from it (such
as System.Delegate SerializationHo lder) are not permitted to be
deserialized at this security level."
Source="ChatApp lication"
StackTrace:
at ChatApplication .My.MyProject.M yForms.Create__ Instance__[T](T
Instance) in 17d14f5c-a337-4978-8281-53493378c1071.v b:line 190
at ChatApplication .My.MyProject.M yForms.get_Clie nt()
at ChatApplication .Client.Main() in C:\tests\chatSo l
\ChatApplicatio n\Client.vb:lin e 8
at System.AppDomai n.nExecuteAssem bly(Assembly assembly,
String[] args)
at System.AppDomai n.ExecuteAssemb ly(String assemblyFile,
Evidence assemblySecurit y, String[] args)
at Microsof

details:

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

Private theManager As InBetween.Manag er

#Region " Windows Form Designer generated code "

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

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

System.Runtime. Remoting.Channe ls.ChannelServi ces.RegisterCha nnel(chan)

theManager =
CType(Activator .GetObject(Type .GetType("InBet ween.Manager,In Between"),
"http://localhost:7777/ChatApplication "), InBetween.Manag er)

AddHandler Me.theManager.e vtReceiveText, AddressOf
Me.HandleReceiv edMsg

end sub
#End Region

Sub HandleReceivedM sg(ByVal username As String, ByVal text As
String)
Me.txtReceivedM sgs.AppendText( username & " : " & text &
vbCrLf)
End Sub

end class

'-------------------------------------Server
Imports System.Runtime. Remoting.Channe ls
Imports System.Runtime. Remoting.Channe ls.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(777 7)

ChannelServices .RegisterChanne l(chan)
System.Runtime. Remoting.Remoti ngConfiguration .RegisterWellKn ownServiceType( _
Type.GetType("I nBetween.Manage r, InBetween"), _
"ChatApplicatio n", WellKnownObject Mode.Singleton)

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

System.Console. ReadLine()

End Sub

end class

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

Imports System

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

Public Class Manager
Inherits MarshalByRefObj ect

Public Event evtReceiveText As ReceiveText

Public Overrides Function InitializeLifet imeService() 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 2187
sh***********@g mail.com wrote:
I am getting the following error while registering the events.

error details: System.InvalidO perationExcepti on was unhandled
Message="An error occurred creating the form. See
Exception.Inner Exception for details. The error is: Type
System.Delegate SerializationHo lder and the types derived from it (such
as System.Delegate SerializationHo lder) 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">
<serverProvider s>
<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
6666
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 Response.BinaryWrite to display a dynamic image on a web page. The server is Windows 2000 SP4.
0
1358
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. ************************************************************ System.EnterpriseServices.RegistrationException: Failed to register assembly 'LR.Server.TransactionManager, Version=1.0.0.1, Culture=neutral, PublicKeyToken=e0e8e60ed826fed8'. ---> System.UnauthorizedAccessException:...
1
3010
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), Ok, you can ignore it, and the installation does finish successfully, but will it influnce the function of my app? Any idea will be very much appreciated. Paul
2
1993
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 is that you can not use regsvr32 to register the COM server so I'm wondering if placing it inside the .NET library will automatically take care of registering it so non managed code programs can access it or do I have to manually use the regasm...
5
1543
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 server (and some other servers - for RMI, application servers). I was still able to run vb.net and C# apps in vs2003. Then, yesterday (Thurs May 12, 2005), I tried running an old aspx app for the first time in months since loading JBuilder and got...
0
1698
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 eProjectNotificationService. Along with registering the service, there is a eProjectNotificationService.exe.config file where you setup your SMTP server settings: <configuration> <appSettings>
1
10368
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 in VB. Its giving me run time error '70' Permission denied. Normally if dlls do not have permission we get error like Error Type: 'Server object, ASP 0178 (0x80070005) The call to Server.CreateObject failed while checking permissions. Access...
0
1208
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 has been thrown by the target of an invocation."
12
4547
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 page which is my client but was gettin some exceptions...am not worried abt the exception at the moment... i went back to the servlet code made some chnges ....and from then on i am gettin a deployment error in build-impl.xml file...
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9958
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.