RE: Problem deserializing file from asp.net



Hi Phillip,

Thanks for the reply.

I determined the username using the getusername function. Which wasn't the
account I expected. I gave the file write permission and it works.

Customerrors is alredy set Off, and I already have an error handler which
should write out an error message, still didn't get this working.

Many thanks,

Steve

"Phillip Williams" wrote:

> You can get a better description of the error by:
> 1) Turning the customErrors to Off in the web.config,
> 2) Enclosing your code in a try catch, e.g.
> Try
>
> Catch ex As Exception
> Response.Write(ex.ToString)
> End Try
>
> As for the file permissions you need to give the ASPNET account write access
> also to the folder pointed to by the SerialiseFileName variable in your code.
>
> HTH
> --
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Steve Bugden" wrote:
>
> > Hi,
> >
> > I am using the XmlSerializer class to deserialize a file, please see
> > attached code.
> >
> > This works fine from a windows form, but fails when called from an asp.net
> > web service. Unfortuantely I can't get a proper error message, the browser
> > just a "this page cannot be displayed" message.
> >
> > I have read that the account the service runs under requires write access to
> > the .net framework temp directory which it has.
> >
> > Could anyone give me any pointers as to why this could be failing.
> >
> > Many thanks for any suggestions,
> >
> > Steve
> >
> > Dim serializer As New XmlSerializer(GetType(MyClass))
> > Dim fstFileStream As FileStream
> > Dim MyObject As MyClass
> > 'Deserialise the file to create the main web site object
> > serializer = New XmlSerializer(GetType(MyClass))
> > fstFileStream = New FileStream(Me.SerialiseFileName,
> > FileMode.Open)
> > 'Ensure the object is updated
> > 'Force the full model to be created
> > MyObject = CType(serializer.Deserialize(fstFileStream), MyClass)
> > If Not fstFileStream Is Nothing Then
> > fstFileStream.Close()
> > fstFileStream = Nothing
> > End If
.



Relevant Pages

  • Re: Cannot read a Security Log from ASP.net web service
    ... it's a very bad idea to grant that permission to the ASPNET ... Here's the error I get after adding the ASPNET account to the Admin group: ... Cannot open log Security on machine .. ... > a web form that calls a web service. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Problem running local asp.net app with web site on network share
    ... Actually, the cause for the error message is in Windows XP, ASP.NET ... Since it is only a local account, ... computer as one account to the UNC folder. ... permission. ...
    (microsoft.public.dotnet.framework.aspnet)
  • xslt file with c# script.
    ... I meant it seems like the web service does NOT have the ... permission to execute the c# code. ... >I got the following error message ... >It seems like the web service does have the permission to ...
    (microsoft.public.dotnet.security)
  • Re: Mobile I amt jam
    ... The error is just "you don't have permission"? ... OWA connection? ... mobile phone to my email account in my exchange server threw GPRS ... connection but I have error message you don't have permission ...
    (microsoft.public.exchange.admin)
  • Re: Problem with database connection
    ... The database attached to the web application was a read-only one. ... I did not find anything named Change Permission. ... The error message I quoted earlier was incorrect.The correct error message ... > account permissions for the folder containing the file - the account should ...
    (microsoft.public.inetserver.asp.db)