-
-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loading .cs files missing dll References? #344
Comments
Source code scripts are limited to use features in the System, System.Drawing and System.Windows.Forms namespaces. If you need any other reference, it is required to compile the script beforehand. |
Any reason you're hard coding just those specific namespaces instead of supporting all System.* references made in the script? |
something simple like the following (hacky approach):
|
Using an IDE for developing scripts and compiling them to binaries is the preferred (and more common) way to go. Plain source code scripts are mainly available for quick prototyping, which usually does not need all the framework references. I guess it won't do any damage to add a few more of the most used ones (like System.Xml and System.Linq) though. |
When I give out code to my team members for testing, it's a lot easier to locate crashes with the .cs file as the exceptions will include the line numbers while the already compiled dll can't provide such granular information about the crash/error. Thanks! |
It can actually. Simply put the .pdb the compiler generated in the same directory and line numbers will show up. |
@bilago If you go with SRP/SOC you shouldn't have to rely on line numbers as you don't have god classes and big methods full of spaghetti code. |
What would you guys suggest as a compact, but sufficient, list of references? |
@crosire @JohnnyCrazy How about the following references?
|
@Fireboyd78 Sounds reasonable, yes. |
if I create a .cs script and reference System.Xml for example I get this when trying to load the game:
Failed to compile 'FiveStarResponse.cs' with 1 error(s):
at line 12: The type or namespace name 'Xml' does not exist in the namespace 'System' (are you missing an assembly reference?)
If I compile the .cs it works without problem. Any way to fix this? Same issue with System.Linq
The text was updated successfully, but these errors were encountered: