-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[FiveM] dynamic types not working after loading this library #85
Comments
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 |
Including the fxmanifest.lua reference? It needs to be added as a client script. |
I tried with and without the reference in the |
This code sample doesn't work while using 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) |
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 |
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 <AssemblyName>$(AssemblyName).net</AssemblyName> Commit: |
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 |
No, I have not tested that |
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 #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:
The text was updated successfully, but these errors were encountered: