[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Re: cannot call non-public or static methods remotely

Sunny

8/4/2004 3:57:00 PM

Hi,

In article <#8uQ92heEHA.3428@TK2MSFTNGP11.phx.gbl>,
anonymous@dotnet247.com says...
> (Type your message here)
> Hi,
> My application is like this.
> When the client starts and the user wants to write to database or files to server.
> he can do that only when a service is running on the server with a particular user.
> the client connects to the remoting service(using the info from config file on the client)
>
> Now I have a dll which will do the write to the database/Fileserver.
> my problem is that I need to have a config file on the server from which the dll can read it and get the info like fileserver/datbase etc.,
>
> Now I have a config file when I try to connect it gives me this error.
>
> Permisionn denied: cannot call non-public or static methods remotely"
>
> Can you pleas e tell me where the error is?
>
> The Code that calls the remoting is
>
> Dim cust As New SingleCallCustomer
> Dim objecturi
> Dim appsettreader As New Configuration.AppSettingsReader '.AppSettingsReader
> Dim testvar As String
> testvar = GetSetting("objuri")
> cust = Activator.GetObject(GetType(RemotingSample.SingleCallCustomer), objecturi)
> ' cust.createdefaultfoldersstep2(intFolderid, strItemtype, newItem, strpath)
> Dim testconfig As String
> testconfig = cust.GetSetting("objuri")
> testconfig = cust.GetSetting("mapphysicalpath")
> testconfig = cust.GetSetting("TRASHCAN")
>
>
>
> Public Function GetSetting(ByVal Key As String) As String
> Try
> Dim config As XmlDocument = New XmlDocument
> config.Load(".\\RemoteCustomer.dll.config")
> Dim elemList As XmlNodeList = config.GetElementsByTagName("add")
> Dim i As Integer
> For i = 0 To elemList.Count - 1 Step i + 1
> If elemList(i).Attributes("key").Value.ToString() = Key Then
> Return elemList(i).Attributes("value").Value.ToString()
> End If
> Next
> Catch ex As Exception
> ' Dim err As String = String.Format("{0} Error with GetSetting. Key = {1}\r\n{2}\r\n", System.DateTime.Now, Key, ex.ToString())
> ' WriteToLogFile(".\\FileManagerError_log.txt", err)
> End Try
> Return ""
> End Function
> --------------------------------
> From: sasidhar jill
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotn...)
>
> <Id>RhUlq0s8q0OaOISjuKzDkA==</Id>
>


1. Where exactly the error happens?

2. I'm not a VB developer, but Activator.GetObject returns object, so
there is need of a cast for sure.

Sunny