[FXServer] EntityFramework + FXServer?

Hey,

I’m using FXServer to have C# on server-side, it is working fine.

Now i’m trying to use EntityFramework, it compiles fine but when i try to load the resource

server_script 'System.Configuration.Install.net.dll'
server_script 'MySql.Data.net.dll'
server_script 'MySql.Data.Entity.EF6.net.dll'
server_script 'System.ComponentModel.DataAnnotations.net.dll'
server_script 'EntityFramework.SqlServer.net.dll'
server_script 'EntityFramework.net.dll'
server_script 'server.net.dll'

It doesn’t load some .dll

Loaded System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a into ScriptDomain_2063026350
Loaded MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d into ScriptDomain_2063026350
Loaded MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d into ScriptDomain_2063026350
error in mono_error_set_bad_image_name:
System.BadImageFormatException:
Failed to load script server/bin/Release/System.ComponentModel.DataAnnotations.net.dll.
Loaded EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 into ScriptDomain_2063026350
Loaded EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 into ScriptDomain_2063026350
Exception loading assembly System.ComponentModel.DataAnnotations: System.IO.FileNotFoundException: Unable to find the specified file.

How can i load that?
I don’t mind giving the source if needed.

Thank you.

Edit:

After using dlls from others sources i managed to load everything, but now when i use EF to send a query to mysql the server closes.

Got any console output around that point?

1 Like

No console output, i also tried to use try{} catch{} to see if it throws anything, but nothing.

The console output is:

...
Started resource sessionmanager
Started resource mapmanager
Started resource spawnmanager
Started resource fivem
Started gametype Freeroam
Started resource hardcap
Started resource ■■■■■■■
Started resource chat
Loaded System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a into ScriptDomain_1017204265
Loaded System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a into ScriptDomain_1017204265
Loaded System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 into ScriptDomain_1017204265
Loaded MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d into ScriptDomain_1017204265
Loaded MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d into ScriptDomain_1017204265
Loaded EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 into ScriptDomain_1017204265
Loaded EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 into ScriptDomain_1017204265
Loaded server.net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_1017204265
Instantiated instance of script server.Main.
Instantiated instance of script server.Database.Main.
Started resource rpfive

C:\Users\user\Documents\FXServer>

rpfive is my resource.

The code used is:

using CitizenFX.Core;
using server.Database.Models;
using System;

namespace server
{
    public class Main : BaseScript
    {
        public Main()
        {
            EventHandlers["onResourceStart"] += new Action<dynamic>(OnResourceStart);
        }

        private void OnResourceStart(dynamic obj)
        {
            Users user = new Users { UserName = "test", Password = "test" };
            ContextFactory.Instance.Users.Add(user); // Server crashes here
        }
    }
}

Thanks!

Edit:
I made a repository if anyone wants to check the resource: https://github.com/ekoozu/temporary

So i figured that i don’t need to load them in __resource.lua if i add the .dlls in root folder.

The only problem is System.ComponentModel.DataAnnotations that doesn’t load (the other one i was using is probably broken).

public Main()
{
    EventHandlers["onResourceStart"] += new Action<dynamic>(OnResourceStart);
}

private void OnResourceStart(dynamic obj)
{
    Users user = new Users { UserName = "test", Password = "test" };
    try
    {
        ContextFactory.Instance.Users.Add(user);
    }
    catch
    {
        Console.WriteLine("fail");
    }
}
Loaded server.net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_2144667770
Instantiated instance of script server.Main.
Instantiated instance of script server.Database.Main.
Started resource rpfive
Exception loading assembly System.ComponentModel.DataAnnotations: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
Exception loading assembly System.ComponentModel.DataAnnotations: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
error in mono_error_set_assembly_load: Could not load file or assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

error in mono_error_set_assembly_load: Could not load file or assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

Exception loading assembly I18N: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
fail
Resolved live-internal.fivem.net:30110 to 151.80.44.223:30110
Sending heartbeat to live-internal.fivem.net:30110
Started resource fivem-map-skater
error in mono_error_set_assembly_load: Could not load file or assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

fail

This assembly should be included as of 3b51800f. Thanks for the report!

1 Like

Thank you! It loaded.

Unfortunately now it gives another error…

It seems the problem is with System.Management

Sorry, i have never experienced that before, been searching for alternatives to make it work.

So far the output now is:

Loaded test.net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_1371364887
Instantiated instance of script test.Class1.
Instantiated instance of script test.Database.Main.
Started resource rpfive
Exception loading assembly System.Management: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
Exception loading assembly System.Management: System.IO.FileNotFoundException: Unable to find the specified file.

error in mono_error_set_assembly_load: Could not load file or assembly 'System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Exception loading assembly I18N: System.IO.FileNotFoundException: Unable to find the specified file.

Exception loading assembly EntityFramework.resources: System.IO.FileNotFoundException: Unable to find the specified file.

error in mono_error_set_assembly_load:

fail

Sorry, I just wanted to use EntityFramework…

Thanks again!

Hm - what is depending on System.Management? EntityFramework.dll doesn’t seem to be.

1 Like

That’s odd, as far as i know System.Management is not being used, it’s not referenced in the project also, i made another project just to make sure.
I don’t know if that’s useful, but the solution explorer is:

Without testing if it helps at all, e1922d7 added System.Management.dll as well.

1 Like

The System.Management error is gone now!

It is complaining about an assembly called I18N, i tried to look for it but i couldn’t find what it is.

Exception loading assembly I18N: System.IO.FileNotFoundException: Unable to find the specified file.

It is also having trouble loading System.Web.Extensions, i tried copying it to the root folder but i couldn’t load it.

Exception loading assembly System.Web.Extensions: System.IO.FileNotFoundException: Unable to find the specified file.

Not sure if it is relevant, but it also said something about MonoPosixHelper:

Error invoking callback for event onResourceStart: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: MonoPosixHelper at....

The full console output below:

Loaded ef.net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_1374205524
Instantiated instance of script ef.Class1.
Started resource ef
Exception loading assembly I18N: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
Exception loading assembly I18N: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
Exception loading assembly System.Web.Extensions: 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 <b3642c6ba1504116b31d83a71003b504>:0
  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) [0x00010] in <b3642c6ba1504116b31d83a71003b504>:0 
Error invoking callback for event onResourceStart: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: MonoPosixHelper
  at (wrapper managed-to-native) System.IO.Compression.DeflateStreamNative:CreateZStream (System.IO.Compression.CompressionMode,bool,System.IO.Compression.DeflateStreamNative/UnmanagedReadOrWrite,intptr)
  at System.IO.Compression.DeflateStreamNative.Create (System.IO.Stream compressedStream, System.IO.Compression.CompressionMode mode, System.Boolean gzip) [0x0004a] in <7d13762c3f3046279fc4d30c52f6f595>:0
  at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, System.IO.Compression.CompressionMode mode, System.Boolean leaveOpen, System.Boolean gzip) [0x0002d] in <7d13762c3f3046279fc4d30c52f6f595>:0
  at System.IO.Compression.DeflateStream..ctor (System.IO.Stream stream, System.IO.Compression.CompressionMode mode, System.Boolean leaveOpen, System.Int32 windowsBits) [0x00000] in <7d13762c3f3046279fc4d30c52f6f595>:0
  at (wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode,bool,int)
  at System.IO.Compression.GZipStream..ctor (System.IO.Stream stream, System.IO.Compression.CompressionMode mode, System.Boolean leaveOpen) [0x00006] in <7d13762c3f3046279fc4d30c52f6f595>:0
  at System.IO.Compression.GZipStream..ctor (System.IO.Stream stream, System.IO.Compression.CompressionMode mode) [0x00000] in <7d13762c3f3046279fc4d30c52f6f595>:0
  at (wrapper remoting-invoke-with-check) System.IO.Compression.GZipStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode)
  at System.Data.Entity.Migrations.Edm.ModelCompressor.Compress (System.Xml.Linq.XDocument model) [0x00006] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.History.HistoryRepository.CreateInsertOperation (System.String migrationId, System.Xml.Linq.XDocument model) [0x00040] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator.ExecuteOperations (System.String migrationId, System.Xml.Linq.XDocument targetModel, System.Collections.Generic.IEnumerable`1[T] operations, System.Collections.Generic.IEnumerable`1[T] systemOperations, System.Boolean downgrading, System.Boolean auto) [0x00129] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator.AutoMigrate (System.String migrationId, System.Xml.Linq.XDocument sourceModel, System.Xml.Linq.XDocument targetModel, System.Boolean downgrading) [0x00150] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.Infrastructure.MigratorBase.AutoMigrate (System.String migrationId, System.Xml.Linq.XDocument sourceModel, System.Xml.Linq.XDocument targetModel, System.Boolean downgrading) [0x0000c] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator.Upgrade (System.Collections.Generic.IEnumerable`1[T] pendingMigrations, System.String targetMigrationId, System.String lastMigrationId) [0x000d3] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Upgrade (System.Collections.Generic.IEnumerable`1[T] pendingMigrations, System.String targetMigrationId, System.String lastMigrationId) [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator.UpdateInternal (System.String targetMigration) [0x0011f] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator+<>c__DisplayClassc.<Update>b__b () [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists (System.Action mustSucceedToKeepDatabase) [0x0006a] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists (System.Action mustSucceedToKeepDatabase) [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.DbMigrator.Update (System.String targetMigration) [0x00014] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update () [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.MigrateDatabaseToLatestVersion`2[TContext,TMigrationsConfiguration].InitializeDatabase (TContext context) [0x00018] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.InternalContext+<>c__DisplayClasse`1[TContext].<CreateInitializationAction>b__d () [0x00011] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.InternalContext.PerformInitializationAction (System.Action action) [0x00016] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization () [0x00098] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4 (System.Data.Entity.Internal.InternalContext c) [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.RetryAction`1[TInput].PerformAction (TInput input) [0x00038] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction (System.Action`1[T] action) [0x00057] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase () [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.InternalContext.Initialize () [0x00006] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType (System.Type entityType) [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.Linq.InternalSet`1[TEntity].Initialize () [0x0000f] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.Linq.InternalSet`1[TEntity].get_InternalContext () [0x00000] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.Linq.InternalSet`1[TEntity].ActOnSet (System.Action action, System.Data.Entity.EntityState newState, System.Object entity, System.String methodName) [0x0002a] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.Internal.Linq.InternalSet`1[TEntity].Add (System.Object entity) [0x00014] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at System.Data.Entity.DbSet`1[TEntity].Add (TEntity entity) [0x00017] in <7efe20822ace47bd8b0086bcc0c47d0d>:0
  at ef.Class1.OnResourceStart (System.Object obj) [0x00026] in <cdeae6bdfb4f4da193ad0020149dda0d>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
  at CitizenFX.Core.EventHandlerEntry+<Invoke>d__5.MoveNext () [0x00133] in <b3642c6ba1504116b31d83a71003b504>:0
Resolved live-internal.fivem.net:30110 to 151.80.44.223:30110
Sending heartbeat to live-internal.fivem.net:30110
Started resource fivem-map-hipster
Started map fivem-map-hipster

I also re-tried the code in another project just to make sure it works and it worked.

Thank you all for the support, i appreciate it a lot.

This always happens.

Hopefully not critical, either.

That’s a bit harder to resolve - can the use of GZipStream (or any of the parent classes) by EF be disabled by configuration? If not, we’ll have to look into somehow configuring zlib building… which server configuration (Linux/PRoot, Linux/Docker, Windows) are you using?

1 Like

I’m using Windows.

I couldn’t find a way to disable GZipStream yet.

In theory, 55f5ae2 should fix this.

1 Like

It worked!

Thank you all! Now i can start focusing on developing.

55f5ae2 what is that?

because i get following too:

Exception loading assembly I18N: 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 <dbf45ef7815e4d73925af74c7a925c89>:0 

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) [0x00010] in <dbf45ef7815e4d73925af74c7a925c89>:0 

Sorry what is 55f5ae2 i have this error:

Exception loading assembly I18N: 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:254 
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:112

not an error, it’s entirely non-fatal

What is that 55f5ae2? I have same problem.

Loaded mysql.net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_863250982
Exception loading assembly I18N: 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:254
  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:112
[vRP/C#] Load MySQL app.

How i can fix this? Because of this problem I can not start vRP databases.

You could try taking the I18N library from the externals folder that I have posted here:

Also, you may need some of the other libraries that I have posted in that externals folder as well to get all of the exceptions to go away. But you shouldn’t need to add those libraries to your resource manifest, just put them in the same folder as the script that is causing you issues.

Let me know if that helps you out or not.