Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - exception when calling a method: object is read-only

Reply
 
Old 05-08-2007   #1 (permalink)
Steve


 
 

exception when calling a method: object is read-only

Hello all,

What does the error below mean? not sure what why this object would be
read-only, or what that has to do with calling a method on it.

PS Z:\> $vaultServer = new-object
Symyx.Framework.Vault.VaultServer("localhost")
PS Z:\> $vaultServer.Logout()
Exception calling "Logout" with "0" argument(s): "Object is read-only."
At line:1 char:20
+ $vaultServer.Logout( <<<< )

My System SpecsSystem Spec
Old 05-09-2007   #2 (permalink)
RichS


 
 

RE: exception when calling a method: object is read-only

It means that the object you obtained cannot be modified. When I've seen
this before it usually means that the object doesn't actually do what I
thought it did

As to why that is - a couple of ideas:

1) does the user account you are using have permissions to whatever the
object represents

2) I presume there is a Logout() method

3) put the object through get-member and see what it returns

4) remember psbase and the other object qualifiers - see if using them can
help
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Steve" wrote:

> Hello all,
>
> What does the error below mean? not sure what why this object would be
> read-only, or what that has to do with calling a method on it.
>
> PS Z:\> $vaultServer = new-object
> Symyx.Framework.Vault.VaultServer("localhost")
> PS Z:\> $vaultServer.Logout()
> Exception calling "Logout" with "0" argument(s): "Object is read-only."
> At line:1 char:20
> + $vaultServer.Logout( <<<< )

My System SpecsSystem Spec
Old 05-09-2007   #3 (permalink)
Steve


 
 

RE: exception when calling a method: object is read-only

Thanks Rich,

(1) get-member returns all the properties and methods on this object, no
problema, including Login, Logout.
(2) i'm signed on to the box as an admin user. This object is simply an
object in a library that i've loaded. it doesnt do anything but call a web
service to authenticate.
(3) is there a way to get better error messages?



"RichS" wrote:

> It means that the object you obtained cannot be modified. When I've seen
> this before it usually means that the object doesn't actually do what I
> thought it did
>
> As to why that is - a couple of ideas:
>
> 1) does the user account you are using have permissions to whatever the
> object represents
>
> 2) I presume there is a Logout() method
>
> 3) put the object through get-member and see what it returns
>
> 4) remember psbase and the other object qualifiers - see if using them can
> help
> --
> Richard Siddaway
> Please note that all scripts are supplied "as is" and with no warranty
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "Steve" wrote:
>
> > Hello all,
> >
> > What does the error below mean? not sure what why this object would be
> > read-only, or what that has to do with calling a method on it.
> >
> > PS Z:\> $vaultServer = new-object
> > Symyx.Framework.Vault.VaultServer("localhost")
> > PS Z:\> $vaultServer.Logout()
> > Exception calling "Logout" with "0" argument(s): "Object is read-only."
> > At line:1 char:20
> > + $vaultServer.Logout( <<<< )

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Calling a Windows DLL method (C++) from C#, passing a structurereference. .NET General
Method '~' of object '~' failed VB Script
exception calling .net object PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46