AutoUpdater.NET icon indicating copy to clipboard operation
AutoUpdater.NET copied to clipboard

AutoUpdater.NET.XmlSerializers.dll not found

Open GamerClassN7 opened this issue 1 year ago • 7 comments

Hello, i am getting to debug console this error AutoUpdater.NET.XmlSerializers.dll

File name: 'AutoUpdater.NET.XmlSerializers, Version=1.8.3.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL' at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly) [08.08.2023-22:06:02][3][HA]System.IO.FileNotFoundException: File name: 'C:\Users\JonatanRek\Downloads\HA_Self_Contained (2)\AutoUpdater.NET.XmlSerializers.dll' at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)

Can anybody help me resolve the issue ?

Thank you in advance for any answer :)

GamerClassN7 avatar Aug 09 '23 07:08 GamerClassN7

Which .NET version are you using? Are you creating a self-contained executable?

ravibpatel avatar Aug 12 '23 05:08 ravibpatel

Yes i am using self-contained also since i use UWM Notification "toats" i am stuck to this version "net6.0-windows10.0.17763.0"

GamerClassN7 avatar Aug 14 '23 11:08 GamerClassN7

any update how to fix the issue since everything's woks normaul it just spam the log

GamerClassN7 avatar Aug 31 '23 09:08 GamerClassN7

Can you try turning on "Just my code" in your project as shown here?

ravibpatel avatar Sep 27 '23 06:09 ravibpatel

Hello already done image still same

GamerClassN7 avatar Nov 30 '23 11:11 GamerClassN7

The important part from the Stackoverflow link above:

[..] this is normal behavior. The constructor of the XmlSerializer first tries to find an assembly named [YourAssembly].XmlSerializers.dll which should contain the generated class for serialization of your type. Since such a DLL has not been generated yet (they are not by default), a FileNotFoundException is thrown. When that happenes, XmlSerializer's constructor catches that exception, and the DLL is generated automatically at runtime by the XmlSerializer's constructor (this is done by generating C# source files in the %temp% directory of your computer, then compiling them using the C# compiler). Additional constructions of an XmlSerializer for the same type will just use the already generated DLL.

The exception is handled by XmlSerializer's constructor. There is no need to do anything yourself, you can just click 'Continue' (F5) to continue executing your program and everything will be fine. If you're bothered by the exceptions stopping the execution of your program and popping up an exception helper, you either have 'Just My Code' turned off, or you have the FileNotFoundException set to break execution when thrown, instead of when 'User-unhandled'

Kurpanik avatar Mar 21 '24 14:03 Kurpanik