Hans Dohse

Hans Dohse

  • NA
  • 1
  • 719

XmlSerialization Exception Could not find file jhjasj.dll

Jun 14 2016 1:01 PM

Once every 2 months or so when my application starts up I get a XmlSerilization Exception on several files of the same type.  There are other files of different types that are also deserialized but do not show this exception. It happens on several different machines.

 
This is the code that I use 

using (FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read))

{

XmlSerializer xs = new XmlSerializer(type);

instance = xs.Deserialize(fs);

fs.Close();

}

Any help would be appreciated.

Here is the exception:
 
Inner Exception: Could not find file 'C:\Users\Maskless\AppData\Local\Temp\jgqmnz6r.dll'.
  Stack Trace
       at Maskless.DataLayer.PropertyData.Restore(String fileName, Type type)
       at System.Xml.Serialization.XmlSerializer..ctor(Type type)
       at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
       at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
       at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
       at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
       at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
       at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources)
       at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
       at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
       at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)