amakvana / EzYuzu

EzYuzu - A Portable Yuzu Updater for Standalone versions of Yuzu
GNU General Public License v3.0
309 stars 28 forks source link

Can't load 'system.Runtime.CompilerServices.Unsafe' #15

Closed Transcan closed 1 year ago

Transcan commented 1 year ago

Describe the bug When I click "update" I get a window with an unhandled exception

To Reproduce Steps to reproduce the behavior: Open EzYuzu Choose the correct path Click "Update" Error appears

Screenshots image

Desktop (please complete the following information):

Additional context I crashes even when opening with admin rights.

amakvana commented 1 year ago

When you extract EzYuzu.zip, you need to make sure you also move all of the .dll files into the same directory as EzYuzu.exe resides in.

So inside the archive, there are all of these files:

image

All of them need to be moved into the same folder you have placed EzYuzu.exe inside

Check this and let me know

Transcan commented 1 year ago

Sorry, I didn't specify it in the report. Yes, all the files are extracted and in the same folder. Tried both, putting all in the Yuzu folder, and in a separate one. In both cases I get the same error.

LoneNomadBlue commented 1 year ago

I have the same error, the previous version worked fine. I have extracted all files into yuzu path ran it as administrator still get the same error. I also gave it its own folder and directed the yuzu path and it still gives the same error.

amakvana commented 1 year ago

Strange as I can't reproduce it on my end, let me have a look into it and get back to you

Could you copy and paste the error message it throws, and paste it here for me?

Transcan commented 1 year ago

My system is in spanish, but I guess the lines you want to see will be readable:

Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración 
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.

************** Texto de la excepción **************
System.IO.FileLoadException: No se puede cargar el archivo o ensamblado 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ni una de sus dependencias. La definición del manifiesto del ensamblado no coincide con la referencia al ensamblado. (Excepción de HRESULT: 0x80131040)
Nombre de archivo: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   en System.ReadOnlySpan`1..ctor(T[] array)
   en System.Text.Json.Serialization.Metadata.JsonPropertyInfo.CacheNameAsUtf8BytesAndEscapedNameSection()
   en System.Text.Json.Serialization.Metadata.JsonPropertyInfo.Configure()
   en System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropertyCache()
   en System.Text.Json.Serialization.Metadata.JsonTypeInfo.Configure()
   en System.Text.Json.Serialization.Metadata.JsonTypeInfo.<EnsureConfigured>g__ConfigureLocked|143_0()
   en System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type type, Boolean ensureConfigured, Boolean resolveIfMutable)
   en System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions options, Type inputType)
   en System.Text.Json.JsonSerializer.DeserializeAsync[TValue](Stream utf8Json, JsonSerializerOptions options, CancellationToken cancellationToken)
   en EzYuzu.MainlineYuzuManager.<GetMainlineGitHubRepoJsonData>d__6.MoveNext()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   en EzYuzu.MainlineYuzuManager.<ProcessYuzuUpdateAsync>d__5.MoveNext()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   en EzYuzu.FrmMain.<BtnProcess_ClickAsync>d__7.MoveNext()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

AVS: El registro del enlace de ensamblado está desactivado.
Para habilitar el registro de errores del enlace de ensamblado, establezca el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1.
Nota: existe una disminución del rendimiento asociada registro de errores del enlace de ensamblado.
Para desactivar esta característica, elimine el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog].

************** Ensamblados cargados **************
mscorlib
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9139.0 built by: NET481REL1LAST_B
    Código base: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
EzYuzu
    Versión del ensamblado: 1.5.0.0
    Versión Win32: 1.5.0.0
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu.exe
----------------------------------------
System.Windows.Forms
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9075.0 built by: NET481REL1LAST_C
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9139.0 built by: NET481REL1LAST_B
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9139.0 built by: NET481REL1LAST_B
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Threading.Tasks.Extensions
    Versión del ensamblado: 4.2.0.1
    Versión Win32: 4.6.28619.01
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/System.Threading.Tasks.Extensions.DLL
----------------------------------------
System.Text.Json
    Versión del ensamblado: 7.0.0.2
    Versión Win32: 7.0.323.6910
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/System.Text.Json.DLL
----------------------------------------
Microsoft.Bcl.AsyncInterfaces
    Versión del ensamblado: 7.0.0.0
    Versión Win32: 7.0.22.51805
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/Microsoft.Bcl.AsyncInterfaces.DLL
----------------------------------------
System.Memory
    Versión del ensamblado: 4.0.1.2
    Versión Win32: 4.6.31308.01
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/System.Memory.DLL
----------------------------------------
System.ValueTuple
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ValueTuple/v4.0_4.0.0.0__cc7b13ffcd2ddd51/System.ValueTuple.dll
----------------------------------------
System.Text.Encodings.Web
    Versión del ensamblado: 7.0.0.0
    Versión Win32: 7.0.22.51805
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/System.Text.Encodings.Web.DLL
----------------------------------------
mscorlib.resources
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_es_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada

Por ejemplo:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.
amakvana commented 1 year ago

@Transcan - thanks for this, Google Translate helps!

I've recompiled the binaries, try this version attached

EzYuzu_Recompiled.zip

Transcan commented 1 year ago

@Transcan - thanks for this, Google Translate helps!

I've recompiled the binaries, try this version attached

EzYuzu_Recompiled.zip

Same error:

Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración 
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.

************** Texto de la excepción **************
System.IO.FileLoadException: No se puede cargar el archivo o ensamblado 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ni una de sus dependencias. La definición del manifiesto del ensamblado no coincide con la referencia al ensamblado. (Excepción de HRESULT: 0x80131040)
Nombre de archivo: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   en System.ReadOnlySpan`1..ctor(T[] array)
   en System.Text.Json.Serialization.Metadata.JsonPropertyInfo.CacheNameAsUtf8BytesAndEscapedNameSection()
   en System.Text.Json.Serialization.Metadata.JsonPropertyInfo.Configure()
   en System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropertyCache()
   en System.Text.Json.Serialization.Metadata.JsonTypeInfo.Configure()
   en System.Text.Json.Serialization.Metadata.JsonTypeInfo.<EnsureConfigured>g__ConfigureLocked|143_0()
   en System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type type, Boolean ensureConfigured, Boolean resolveIfMutable)
   en System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions options, Type inputType)
   en System.Text.Json.JsonSerializer.DeserializeAsync[TValue](Stream utf8Json, JsonSerializerOptions options, CancellationToken cancellationToken)
   en EzYuzu.MainlineYuzuManager.<GetMainlineGitHubRepoJsonData>d__6.MoveNext()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   en EzYuzu.MainlineYuzuManager.<ProcessYuzuUpdateAsync>d__5.MoveNext()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   en EzYuzu.FrmMain.<BtnProcess_ClickAsync>d__7.MoveNext()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

AVS: El registro del enlace de ensamblado está desactivado.
Para habilitar el registro de errores del enlace de ensamblado, establezca el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1.
Nota: existe una disminución del rendimiento asociada registro de errores del enlace de ensamblado.
Para desactivar esta característica, elimine el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog].

************** Ensamblados cargados **************
mscorlib
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9139.0 built by: NET481REL1LAST_B
    Código base: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
EzYuzu
    Versión del ensamblado: 1.5.0.0
    Versión Win32: 1.5.0.0
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu%20Updater/EzYuzu.exe
----------------------------------------
System.Windows.Forms
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9075.0 built by: NET481REL1LAST_C
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9139.0 built by: NET481REL1LAST_B
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9139.0 built by: NET481REL1LAST_B
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Threading.Tasks.Extensions
    Versión del ensamblado: 4.2.0.1
    Versión Win32: 4.6.28619.01
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu%20Updater/System.Threading.Tasks.Extensions.DLL
----------------------------------------
System.Text.Json
    Versión del ensamblado: 7.0.0.2
    Versión Win32: 7.0.323.6910
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu%20Updater/System.Text.Json.DLL
----------------------------------------
Microsoft.Bcl.AsyncInterfaces
    Versión del ensamblado: 7.0.0.0
    Versión Win32: 7.0.22.51805
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu%20Updater/Microsoft.Bcl.AsyncInterfaces.DLL
----------------------------------------
System.Memory
    Versión del ensamblado: 4.0.1.2
    Versión Win32: 4.6.31308.01
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu%20Updater/System.Memory.DLL
----------------------------------------
System.ValueTuple
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ValueTuple/v4.0_4.0.0.0__cc7b13ffcd2ddd51/System.ValueTuple.dll
----------------------------------------
System.Text.Encodings.Web
    Versión del ensamblado: 7.0.0.0
    Versión Win32: 7.0.22.51805
    Código base: file:///F:/Juegos/RetroBat/emulators/yuzu/EzYuzu%20Updater/System.Text.Encodings.Web.DLL
----------------------------------------
mscorlib.resources
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_es_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
    Versión del ensamblado: 4.0.0.0
    Versión Win32: 4.8.9032.0 built by: NET481REL1
    Código base: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada

Por ejemplo:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.
rakantoh commented 1 year ago

same error to me with the latest public release and with the attached file recompiled, all my soft are up to date, win10 pro x64 22h2

amakvana commented 1 year ago

Looks like there are a couple of conflicts between Ookii.Dialogs.WinForms and System.Text.Json, as they both want to use different versions of System.Runtime.CompilerServices.Unsafe at the same time. Not sure why this error didn't throw on my machine and test machine.

I have downgraded Ookii.Dialogs.WinForms back to 1.2.0 and switched to Newtonsoft.Json for Json deserialisation.

@Transcan, @rakantoh, @LoneNomadBlue - try the attached copy below and see if this resolves.

EzYuzu_TestBuild_2.zip

Delete the previous copy of EzYuzu, and the previous dll files

LoneNomadBlue commented 1 year ago

It works! Now there's no conflict. I had to redownload another portable copy of an older build of yuzu to test since I just ended up updating yuzu with an earlier version of EzYuzu.

amakvana commented 1 year ago

It works! Now there's no conflict. I had to redownload another portable copy of an older build of yuzu to test since I just ended up updating yuzu with an earlier version of EzYuzu.

Thanks for confirming the changes work! I will wait on the others to confirm.

Afterwards, I'll push the changes and release 1.5.1.0 to patch this issue. It may be tomorrow as it's getting late here

Transcan commented 1 year ago

Looks like there are a couple of conflicts between Ookii.Dialogs.WinForms and System.Text.Json, as they both want to use different versions of System.Runtime.CompilerServices.Unsafe at the same time. Not sure why this error didn't throw on my machine and test machine.

I have downgraded Ookii.Dialogs.WinForms back to 1.2.0 and switched to Newtonsoft.Json for Json deserialisation.

@Transcan, @rakantoh, @LoneNomadBlue - try the attached copy below and see if this resolves.

EzYuzu_TestBuild_2.zip

Delete the previous copy of EzYuzu, and the previous dll files

This version also works for me. 👌

rakantoh commented 1 year ago

Looks like there are a couple of conflicts between Ookii.Dialogs.WinForms and System.Text.Json, as they both want to use different versions of System.Runtime.CompilerServices.Unsafe at the same time. Not sure why this error didn't throw on my machine and test machine.

I have downgraded Ookii.Dialogs.WinForms back to 1.2.0 and switched to Newtonsoft.Json for Json deserialisation.

@Transcan, @rakantoh, @LoneNomadBlue - try the attached copy below and see if this resolves.

EzYuzu_TestBuild_2.zip

Delete the previous copy of EzYuzu, and the previous dll files

I confirm too, works fine now, in both yuzu version (mainline and early)

amakvana commented 1 year ago

Thank you all for confirming the changes worked! Will push this shortly

amakvana commented 1 year ago

Closed - Fixed in v1.5.1.0 https://github.com/amakvana/EzYuzu/releases/latest

NOTE: The test builds uploaded above are now invalidated