[C#] System.IO.FileNotFoundException


#1

Hello everyone! Im trying to add dll for manage json to my clients, but in any way i do that i get error on client

System.IO.FileNotFoundException: Unable to find the specified file.

Here is my _resource.lua at that moment:

client_scripts {
	"JsonManager.Extended.dll",
	"MyServer.Client.net.dll"
}

Im already trying in testing different methods to add that dll to my clients file with no luck. Any help would be appreciated! :smiley:
Answering to question why im just cant use Newton’s json dll is that its doesnt fit all my needs. Also all my DLLs placed in same folder that contain _resource.lua


#2

Hi,

If I remember correctly, C# dll need to end by “net.dll”


#3

Thanks for your reply!
Im checked github here => https://github.com/yuvalino/main-chat/blob/master/__resource.lua and there is Newtonsoft.Json.dll without any net.dll at the end. :thinking:


#4

Humm, ok so the “net.dll” is maybe only for FiveM dll.

but I wonder if your error is because the dll isn’t found or if it’s when you try to open a file with your library.


#5

Im trying to use it in my FiveM client dll with using, but its throw error about file cant found. I cant really figure out why dll cant be found if its in the folder same with resource.lua. :fearful:


#6

Im also readed related problems on forum like THAT. Also tried recomendations in that threads. Still no luck.


#7

Just to test, did you try if it works on server side?

I have an other idea, “client_script” is to transfer and execute the file, “file” like this will only transfer the file.


#8

Thank for your reply!

Okay, i can now load dll i wanted to, but i cant find out how to get .mdb for newest versions (For example for System.Net.dll i guess its 4.0.0.0 (Yes i know that i cant easly import it, but its only example))


#9

Uh - these days Mono uses (embedded) portable PDBs.


#10

Thank you for reply!

I still cant get it (lol), do i need to include PDBs to the client side?


#11

You only need .dll on client side


#12

If im set only dll like that:

file {

"System.Net.dll"

}

Its throw error about FileNotFoundException, but if im include .mdb its all right, but i cant get mdb or pdb for new version of dll. Here is log with .mdb:

Loaded System.Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a into ScriptDomain_911901468

and without it:

Failed to run a tick for Client: System.IO.FileNotFoundException: Could not load file or assembly 'System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.


#13

What do you mean by “cant get mdb or pdb for new version of dll”?


#14

I found this, if it’s what you’re looking for


#15

For example: I need to use System.Net.dll on the client, the only way i can use it is include System.Net.dll.mdb to the client’s files, but i can find only old version of mdb. Sorry for a misunderstanding on my part, I did not quite understand how to use System.Net.dll or another windows lib on the client.


#16

… using .mdbs has nothing to do with being able to load a library or not, in addition to that the client is sandboxed so you won’t be able to use any APIs from such libraries anyway.


#17

K, thats pretty sad. Thank you all guys for help!