M G Vinod Kumar\’s Technology Blog

February 23, 2007

.NET Error

Filed under: .NET, Debugging — mgvinod @ 11:14 am

Below is the complete error which I came across recently. I was stuck with it for hours and it could not have come at a worse time – UAT phase ready to sign off and go into production.

System.IO.FileNotFoundException: File or assembly name lz2ikglf.dll, or one of its dependencies, was not found.
File name: "lz2ikglf.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, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, Type[] extraTypes)
at Microsoft.Practices.EnterpriseLibrary.Configuration.SerializerCache.GetSerializer(Type baseType, Type[] types)
at Microsoft.Practices.EnterpriseLibrary.Configuration.Transformer.XmlSerializerTransformer.CreateXmlSerializer(Type valueType)
at Microsoft.Practices.EnterpriseLibrary.Configuration.Transformer.XmlSerializerTransformer.Deserialize(Object section)
at Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationBuilder.ReadConfiguration(String sectionName)
at Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManager.GetConfiguration(String sectionName)

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\DOCUME~1\SVC_FC~1\LOCALS~1\Temp\1\lz2ikglf.dll
LOG: Appbase = T:\WorkUnitGenerator\
LOG: Initial PrivatePath = NULL
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/SVC_FC~1/LOCALS~1/Temp/1/lz2ikglf.dll.

Looking at the problem, it looks like the System.CodeDom.Compiler compiles the assembly and then while trying to load it back in, it cannot find the file. Hence the System.IO.FileNotFoundException thrown. First thing to check is the write permission on this directory. That seems to be not a problem.

After much googling, came across a suggestion to reinstall .NET framework again. Weird as it seems, on one of the machines, it seems to have done the trick. But on another it didn’t work.

So, if you come across this issue and none of the above worked, then try reinstalling OS. Have fun! 🙂 Also, don’t forget to leave comment about your experiences if you have come across this.

Advertisements

Blog at WordPress.com.