0x0ade / XnaToFna

Relink games / tools using the XNA Framework 4.0 to use FNA instead
zlib License
52 stars 5 forks source link

Loading game ModuleDefinition can fail on macOS #9

Closed 0x0ade closed 6 years ago

0x0ade commented 6 years ago

Migrated from https://github.com/FNA-XNA/FNA/issues/166, CC @CNAmira

Collected information about original issue below:

Yes, I'm using Mac for daily use. I've also tried on my PC, but it reports an error like call to a missing method. -- @CNAmira

Log:

[XnaToFna] [Version] 17.11.3.34824
[XnaToFna] [ScanPath] Checking assembly Stardew Valley (rw)
[XnaToFna] [ScanPath] XnaToFna-ing Stardew Valley
[XnaToFna] [ScanPath] Scanning directory /Users/alpine/Stardew Valley
[XnaToFna] [ScanPath] Found Content directory: /Users/alpine/Stardew Valley/Content
[XnaToFna] [ScanPath] Checking assembly BmFont (rw)
[XnaToFna] [ScanPath] Checking assembly FNA (r-)
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Avatar -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Content.Pipeline -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Game -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Graphics -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Input.Touch -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Storage -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Video -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Xact -> FNA
[XnaToFna] [ScanPath] Checking assembly GalaxyCSharp (rw)
[XnaToFna] [ScanPath] Checking assembly Lidgren.Network (rw)
[XnaToFna] [ScanPath] Checking assembly Netcode (rw)
[XnaToFna] [ScanPath] Checking assembly Stardew Valley (rw)

Unhandled Exception:
System.IO.IOException: Sharing violation on path /Users/alpine/Stardew Valley/Stardew Valley.exe
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <bb7b695b8c6246b3ac1646577aea7650>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <bb7b695b8c6246b3ac1646577aea7650>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <d78877a5c52c41829df4feaac055547e>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <d78877a5c52c41829df4feaac055547e>:0 
  at MonoMod.MonoModExt.ReadModule (System.String path, Mono.Cecil.ReaderParameters rp) [0x0001d] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.XnaToFnaUtil.ScanPath (System.String path) [0x00278] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.XnaToFnaUtil.ScanPaths (System.String[] paths) [0x0000a] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.XnaToFnaUtil.ScanPath (System.String path) [0x001a5] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.Program.Main (System.String[] args) [0x00465] in <d78877a5c52c41829df4feaac055547e>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Sharing violation on path /Users/alpine/Stardew Valley/Stardew Valley.exe
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <bb7b695b8c6246b3ac1646577aea7650>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <bb7b695b8c6246b3ac1646577aea7650>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <d78877a5c52c41829df4feaac055547e>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <d78877a5c52c41829df4feaac055547e>:0 
  at MonoMod.MonoModExt.ReadModule (System.String path, Mono.Cecil.ReaderParameters rp) [0x0001d] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.XnaToFnaUtil.ScanPath (System.String path) [0x00278] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.XnaToFnaUtil.ScanPaths (System.String[] paths) [0x0000a] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.XnaToFnaUtil.ScanPath (System.String path) [0x001a5] in <d78877a5c52c41829df4feaac055547e>:0 
  at XnaToFna.Program.Main (System.String[] args) [0x00465] in <d78877a5c52c41829df4feaac055547e>:0 
0x0ade commented 6 years ago

@CNAmira Can you please retry with the latest release (v18.05.0)? I've updated the dependency on cecil. If the issue still occurs, it's an issue with XnaToFna itself.

Weirdly enough, Windows is strict about opening the same file multiple times, yet it works just fine for me here.

QianNangong commented 6 years ago

Latest release works, Thanks.