Closed Sander0542 closed 1 year ago
Hm... weird.
What specific LemonUI features are you using?
It happens when I load the library and not even use any of the features. Just adding the NuGet packages triggers the error.
When I add all the .cs
files to the project and compile it there it works.
It happens when I load the library and not even use any of the features
Including the fxmanifest.lua reference? It needs to be added as a client script.
I tried with and without the reference in the client_scripts
property in the fxmanifest.lua
This code sample doesn't work while using LemonUI.FiveM
public class ClientMain : BaseScript
{
public ClientMain()
{
Tick += PlayerJoinedTick;
}
private async Task PlayerJoinedTick()
{
if (API.NetworkIsPlayerActive(API.PlayerId()))
{
Exports["spawnmanager"].setAutoSpawn(false);
Tick -= PlayerJoinedTick;
}
}
}
I did some testing myself and was able to build a NuGet package which works.
This commit fixes the error (I only tested with FiveM) https://github.com/LemonUIbyLemon/LemonUI/commit/292e1f303b479661f59e7ab68b2d5bc2aaba518b
Ill take a deeper look tomorrow Sunday.
I'm gettting the same problem and I think its related to Exports in CitizenFX.Core. For some reason, if LemonUI is loaded, whenever you use Exports, the exception System.TypeLoadException: Could not resolve type with token 0100000e
will be thrown.
Pinpointed the problem back to version 1.3.0, so this was caused by something between 1.2.0 and 1.3.0.
Ill try to see what I can do, but I would expect this to be fixed in the FiveM codebase instead of a LemonUI patch, as is not a LemonUI bug.
When I updated the build system in my branch, I got it to work with the latest FiveM version. I am not very experienced with the C# compiler, but maybe you could take a look at my branch and see what could have fixed it.
One change that stands out is the removal of the .net
suffix in assembly name of the FiveM csproj
<AssemblyName>$(AssemblyName).net</AssemblyName>
Commit: https://github.com/LemonUIbyLemon/LemonUI/commit/292e1f303b479661f59e7ab68b2d5bc2aaba518b
Compare: https://github.com/LemonUIbyLemon/LemonUI/compare/master...Kifflom-Creations:LemonUI:master
That could work, yes. But this appears to be a FiveM bug that needs to be diagnosed and fixed upstream.
By the way, have you tried to just rename LemonUI.FiveM.net.dll
to LemonUI.FiveM.dll
?
By the way, have you tried to just rename
LemonUI.FiveM.net.dll
toLemonUI.FiveM.dll
?
No, I have not tested that
Interesting...
Managed to trigger the same FiveM crash again:
Ill end up using the solution suggested by @Sander0542
Looks like FiveM doesn't knows how to deal with the libraries set as client_script(s), so you will always see one of this:
The behavior changes depending on the LemonUI version. Recent versions (1.3-master) show the exception, while old versions (alpha-1.2) show the crash.
Not gonna lie, I have been trying to fix this shit for months, fucking burnout got me every single time.
As it turns out, it was FiveM all along.
@Sander0542 would you be kind to send the Pull Request? So you get the credit for the commit :)
I created a pull request with the required changes https://github.com/LemonUIbyLemon/LemonUI/pull/99
If you want me to implement GitVersion, so you don't have to manually change the version for every release, then let me know and I'll create another PR with that part
After this library has been loaded by the FiveM client, the
dynamic
type doesn't work anymore.I ran the same code, but without LemonUI. That worked without any exceptions. Why could this happen?
Stacktrace: