In my experience this is almost always an ACL issue, that the ASPNET user
cannot read or write to the correct directories.

Usually the directory in question is c:\winnt\temp. But in your case it
appears to be in documents and settings\aspnet.  I'd do two things:

1) Give the ASPNET user access to that dir (or perhaps the
IUSR_<machinename> - since likely that is who the thread is running as
assuming you has anonymous access on and your web.config is set up the way
you described).  Actually turning off impersonation might help actually.

2) download filemon from www.sysinternals.com.  Run filemon while this is
happening.  It will tell you exactly what file(s) are trying to be read and
you can then try to adjust permissions from there.

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Taylor, Rick (US -
Hermitage)
Sent: Monday, January 19, 2004 9:25 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] XmlSerializer problem through WebService

Hi all,

I'm having an interesting problem concerning the XmlSerializer and web
services. I have a serializable class that I intend to return through a web
service to my client. What is happening is that XmlSerializer is reflecting
the class in question, creating a DLL, and then attempting to load its newly
created DLL (as it normally does). It unfortunately is unable to do this.
The exception being thrown follows this message. It actually looks like it
never creates the DLL in the first place. The assembly binding log viewer
doesn't show any attempts.

Right now, I have the web site (a virtual dir, actually, on the default
site) set basically wide open. Like, bad wide open -- it shouldn't be having
permission problems, IMO. I'm allowing access to scripts and executables,
and allowing r/w/browse on the virtual dir, and ASPNET is admin on this
machine. The security mode is windows.  I've also added the following to my
web.config :

                <compilation defaultLanguage="C#" debug="true">
                        <assemblies>
                                <add assembly="*" />
                        </assemblies>

                </compilation>

                <identity impersonate="true" />

So far, no luck. Oh, I have also turned off indexing services for the drive
(read that on a google hit, don't know what difference that would make).
The XmlSerializer does not have these problems in a Winforms app. The
machine is win2kPro.

So, I'm stumped. Anyone want to take a whack at this?

Thanks,

Rick

System.IO.FileNotFoundException: File or assembly name z233ihj5.dll, or one
of its dependencies, was not found.
File name: "z233ihj5.dll"
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence
assemblySecurity)
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.Xml.Serialization.Compiler.Compile()
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
   at
System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInf
o[] methodInfos)
   at
System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMet
hodInfo[] methodInfos)
   at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type
type, LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)

=== Pre-bind state information ===
LOG: Where-ref bind. Location =
C:\DOCUME~1\USPSCR~1\ASPNET\LOCALS~1\Temp\z233ihj5.dll
LOG: Appbase = file:///C:/Inetpub/wwwroot/ESS
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL
file:///C:/DOCUME~1/USPSCR~1/ASPNET/LOCALS~1/Temp/z233ihj5.dll.



This message (including any attachments) contains confidential information
intended for a specific individual and purpose, and is protected by law.  If
you are not the intended recipient, you should delete this message.  Any
disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited.

===================================
This list is hosted by DevelopMentor.  http://www.develop.com Some .NET
courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to