[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: "Permisionn denied: cannot call non-public or static methods remot

Sunny

7/24/2004 2:49:00 AM

Hi,

enable customErrors = off so you can receive the whole exception. It will
show you on what line the exception is thrown.
Search in this group, recently I have explained how.

Sunny

..NetHelpWanted wrote:

>
> 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
> --------------------------------
>
> .NetHelpWanted