|
| Deserilize can't find tempory dll? |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.xml.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Scott Crowder |
| GOOD ANSWER |
I am trying to use the XmlSerializer.Deserialize method and I am getting a fileNotFound expection for a tempory dll that should be produced by the serializer.
I have a set of classes generated by XSD.exe from a fairly complex xsd file. I get the error when I try to new the XMLSerializer(typeof(myClass)) constructor.
Does anyone have a suggestion on what I am doing wrong? I'm using framework 1.1 on Win2003 server
|
|
|
| |
|
|
| |
| |
| Dino Chiesa [Microsoft] (VIP) |
| GOOD ANSWER |
I think this is a FAQ http://www.google.com/search?hl=en&num=30&q=serialization+System.IO.FileNotFoundException+xml
Sometimes you can get a "assembly not found" error at runtime when using the xml serializer. eg,
Unhandled Exception: System.IO.FileNotFoundException: File or assembly name zhv7pjut.dll, or one of its dependencies, was not found.
File name: "zhv7pjut.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..ctor(Type type, String defaultNamespace) at System.Xml.Serialization.XmlSerializer..ctor(Type type) at dinoch.demo.GetSBI.Main() in c:\dinoch\dev\dotnet\SBI\testcase.cs:line 10
This can happen for various reasons. - if the classes you are serializing include jagged arrays or other unhandled data formats - if you do not have permission to the temp directory (can happen on WS2003 or when you run your app from a new identity) - if the .NET Framework install is broken - maybe other reasons
check this tool to help troubleshoot the first problem http://www.sellsbrothers.com/tools/#XmlSerializerPreCompiler
for the 2nd issue, check the Fusion log - it will indicate pathnames. Verify that your user is able to read/write to the specified location. Eg, if an ASP.NET page, then verify that ASPNET (or whoever) is able to write to c:\windows\temp (or whatever the dir is).
-- Dino Chiesa Microsoft Developer Division d i n o c h @ o n l i n e . m i c r o s o f t . c o m
"Scott Crowder" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... > I am trying to use the XmlSerializer.Deserialize method and I am getting a fileNotFound expection for a tempory dll that should be produced by the serializer. [Original message clipped]
constructor. [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Chango V. |
| GOOD ANSWER |
Here's my reason for getting this error: I had a couple of classes that were not public. It's in the documentation, but it bit me unexpectedly, and without Google I would've had a hard time figuring it out. I think the crux of the problem is error mishandling within the XmlSerializer: none of the error messages returned in exceptions point to the real problem.
//
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|