2013-01-09 14 views
3

建我得到使用勺子Studio和.NET 4.0FileNotFoundException異常與應用XmlSerializers使用勺子Studio .Net的4.0

Exception='System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\temp\Serialization\mf3je3jx.dll' or one of its dependencies. The system cannot find the file specified. 
File name: 'file:///C:\temp\Serialization\mf3je3jx.dll' 
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) 
    at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() 
    at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, 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.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace) 
    at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace) 

包裝我們的虛擬化應用程序下面的異常這是工作的罰款,直到我們都用上了。 Net 3.5,但在遷移到.Net 4.0包後,我們開始看到這個錯誤。

我知道解決這個問題的方法之一是預先生成XmlSerializers,但在我們的情況下,我們有多個加載項也需要重新構建,我們希望避免這樣做。

我的問題是爲什麼會發生這種情況?爲什麼運行時不能在運行時生成序列化程序?我可以看到臨時目錄中生成的.cs和.out文件(dll也會立即生成並立即刪除)。

如果我在沒有虛擬化的情況下運行我的應用程序,它工作正常,並且能夠構建和加載內存中的序列化程序。運行應用程序的用戶在兩種情況下都是相同的。

歡迎任何建議。

這是一個單獨的問題,但是我無法在VS或 的WinDbg調試這個(我得到的CLR版本不匹配錯誤的B/W VS和應用程序)

原因是:在安裝VS12/.NET 4.5在機器上將CLR 版本號升級到4.0.30319.17929,而應用程序使用 4.0.30319.1。和VS不允許我附加到這個應用程序

回答

2

我們發現了這個問題。

由Spoon Studio for .NET 4.0使用的默認.Net圖像沒有包含所有必需的程序集。

這是Spoon Studio中的一個錯誤。我通過從SpoonStudio團隊獲取新的自定義圖像來工作。

相關問題