FileNotFoundException and Proxy constructor

G

Graham Allwood

Hi,

I have been reading several posts where people are getting a
FileNotFoundException when trying to construct a web service proxy. The file
that is reported missing changes everytime.

There has been several different reasons for this in the past including
permissions to the c:\winnt\temp folder, missing default constructor and
duplicate enum definitions in the schema. Well, I have another reason for
this to happen:

I have an assembly that contains all the custom types my services use. When
I reference my service in my WinForms app I have to modify the proxy that is
generated for me; specifically I have to remove the generated definition for
my types and add a USING statement so that it picks up my own type
definitions. Everything was working fine until I started using a type when
one of the properties was using the new (C#) operator to hide a property
definition in a base class. This caused the proxy constructor to fail with
the about error. Commenting out the property made everything work again.

Can anyone explain this to me? Is it something to do with the XmlSerializer,
if so what?

Thanks for any help

Graham Allwood
 
G

Graham Allwood

Ok, so I should learn not to post things too early, right? The problem
wasn't the new operator on the property, it was because this property was
read only.

I'am wondering if I should implement ISerializable in order for me to stick
with read only properties. Any comments?

Graham
 
J

Jan Tielens

You can't use read only properties when you want your class to be
serializable... It's a pitty I know, but when you think about it, it
actually makes sense.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top