[BUG] Regular Expressions
Prerequisites
- [X] I made sure I am running the latest development build
- [X] I tried to look for similar issues before opening a new one
- [X] I have set
debugmessages=truein config to diagnose my issue - [X] I have redacted session tokens and passwords before attaching screenshots
Minecraft Version
1.19.2
Console Client Version
Latest
Expected Behavior
Regular expression in chatbot should work
Actual Behavior
Compiling/Loading a script using regex gives an error.
23:10:22 [MCC] Starting compilation of: '98025518-a3f9-4b4c-bc31-7be554933cf6' 23:10:22 [MCC] Compilation done with error. 23:10:22 [MCC] [Script] Script 'scripts/wiki.cs' failed to run (LoadError). 23:10:22 [MCC] [Script] System.InvalidOperationException: The type or namespace name 'RegularExpressions' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)
I tried loading it with and without manual/extra imports for System/System.Text.RegularExpressions in the script file. Same error.
Steps to Reproduce the bug
- Use example script with chatbot
- Write code with regex
- Compile/Load with error
Attach screenshot here (If applicable)
No response
Anythings that could help diagnosing the bug
No response
Device
VPS
Operating System
Linux
Server Address (If applicable)
No response
@breadbyte How this can be solved, started happening after .NET 5 update?
A temporary workaround that you can do for now is to build the entire project alongside your script (use the ChatBots folder for reference) and call it here.
I'm not sure what's causing this issue as there is already a reference for System.Text.RegularExpressions (and System.Text too), so the assembly is being referenced correctly in most cases... except this one.
This should be fixed now.