Information
I was trying to create a Client+Server resource with .NET Resources to support localizations and all, but it ended up crashing because FiveM was trying to load the stuff from the resx as a separate file.
Repro Steps
The short one
- Create a FiveM resource with Client, Server and Shared dlls
- Add a
Resources.resx
- Build the solution and create a
__resource.lua
- Put the resource on
server-data\resources
and start it
The long one
- Clone the code of GGOMP at 852a93c65a61c1e89dfd3dd88bf65add8ec95418
- Restore the Git Submodules
- Restore the NuGet packages on the solution
- Build the GGOMP.sln solution on Visual Studio 2017
- Copy the
bin\Debug
folder and paste it on yourserver-data\resources
folder as “ggo” - Add
start ggo
on yourserver.cfg
Expected Behaviour
The resource boots up without problems.
Actual Behaviour
Exception loading assembly GGO.Shared.net.resources: System.IO.FileNotFoundException: Unable to find the specified file.
Server stack trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at (wrapper cominterop) CitizenFX.Core.IScriptHost:OpenHostFile (string)
at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost:OpenHostFile (string)
at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile (System.String fileName) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\MonoScriptRuntime.cs:266
at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (object,byte[]&,byte[]&,string)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
at CitizenFX.Core.InternalManager.LoadAssembly (System.String name) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\InternalManager.cs:120
Exception loading assembly GGO.Shared.net.resources: System.IO.FileNotFoundException: Unable to find the specified file.
Server stack trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at (wrapper cominterop) CitizenFX.Core.IScriptHost:OpenHostFile (string)
at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost:OpenHostFile (string)
at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile (System.String fileName) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\MonoScriptRuntime.cs:266
at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (object,byte[]&,byte[]&,string)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
at CitizenFX.Core.InternalManager.LoadAssembly (System.String name) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\InternalManager.cs:120
Versions
- Windows 10 Pro Version 1803 Build 17134.376
- FiveM Client Build
846-02ffd61d969ef76e4ccdda513957b8f34a40d3f3
- FiveM Server Build
838-50fae9743a7e34b5e7a9d0799a7d46019ad5838f