-
Notifications
You must be signed in to change notification settings - Fork 370
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
Private static variables cause meaningless exception on mono #1073
Comments
@tobiaszuercher it may well be a mono issue. In the forthcoming 0.15 release (hopefully just days away) the full stack trace will be printed to the console when an error occurs (see #987). In the meantime, you could try running your script using the nightly build https://www.myget.org/gallery/scriptcsnightly |
Hi @tobiaszuercher. This is a quirk, a small difference between the mono and the roslyn engine. Mono doesn't like their toplevel variables to have access modifiers nor being static ... probably because they make little sense in this context. So this should work in mono string regexString = @"[\d\.]+[^-]+\.(?<number>\d+)-{0}";
string regexStringWithoutBranch = @"[\d\.]+[^-]+\.(?<number>\d+)$"; We will probably not fix this as this is a mono issue, not scriptcs. FYI @adamralph p.s yeah, the error message you got sucked ... we're working on it |
@ztone thanks for the info! I think even with the stack trace we would have had a hard time figuring that out 😄 btw
I guess you mean
|
Hi @adamralph What I meant is that this "bug" (if it is a bug, might be by design) is in Mono.CSharp and therefore not maintained by us. Even if I would issue a PR to the mono project that fixes this I'm not sure that it will be accepted because why does a toplevel variable need to be private? However what we might be able to do here, just to make our roslyn and mono engine a bit more compatible, is to use our pre-parser and remove any keywords from toplevel variables before passing it to the Mono.CSharp evaluator. |
@ztone ok, makes sense. The whole top-level variable thing is weird. In Roslyn, these actually end up (counter-intuitively) as being fields in a class. A design I've challenged, but it seems to be sticking. I guess we could do what you suggest and strip away the access and static modifiers in pre-parsing. |
wow, thank you all for the comments! i just copied & pasted code from a console exe. and yes, the private static doesn't really make sense there! still happy to see more output if something goes wrong (even in that case a stacktrace wouldn't be that helpful). looking forward to 0.15! thank you guys <3 |
fixed by #1216 |
thank you guys for all your effort! |
The following script:
The scripts needs
scriptcs -install Octopus.Client
Works perfectly on windows. On ubuntu with mono, i get the following error:
How can i get more info about the error? The -debug flag doesn't give me enough information to fix the issue.
Is it possible that this is a mono issue?
The text was updated successfully, but these errors were encountered: