當試圖在引用的程序集中執行一個函數時,我有這個奇怪的錯誤。我有程序集的源代碼,並沒有命名空間稱爲「XmlSerializers」,所以我不能爲我的生活理解爲什麼它試圖加載'Netaccounts.Ola.RestClient.XmlSerializers'爲什麼.NET試圖加載一個不存在的程序集?
任何人都可以建議從哪裏開始解決這個問題?我認爲.Net框架或視覺工作室有些問題,因爲這對我來說毫無意義。
它發生在這條線
XmlSerializer serializer = new XmlSerializer(type);
但XmlSerializer的是從的System.Xml.Serialization到來。我甚至重寫代碼,但沒有效果。我犯了同樣的錯誤。
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(type);
乾杯!
BindingFailure occurred
Message: Managed Debugging Assistant 'BindingFailure' has detected a problem in 'D:\Local Dev Projects\Projects\WRJ Studio\WRE Quote Builder\bin\Debug\WRJ Studio.vshost.exe'.
Additional information: The assembly with display name 'Netaccounts.Ola.RestClient.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Netaccounts.Ola.RestClient.XmlSerializers, Version=1.0.5101.5654, Culture=neutral, PublicKeyToken=1809573d4ad081b2' or one of its dependencies. The system cannot find the file specified.
只要確定:你確定它是你的代碼上的行它是拋出錯誤? –