-
Notifications
You must be signed in to change notification settings - Fork 389
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
Allow globally suppressing compiler warnings #762
Comments
Here's an example of where I have to add #pragmas to suppress these, and on one of the executable blocks it doesn't even work (see toward the bottom where the warning is still emitted): https://github.com/heaths/azure-sdk-notebooks/blob/886ca19ead4c3de9a921e47ee03c0c84bcfa3d68/dotnet/Secrets%20in%20Key%20Vault.ipynb |
I have a block that is emitting 3 of these warnings, and the pragma statement only removes 1 of them, leaving the other 2 present. |
We would probably implement a fix for this related to #890. The general goal there is to make sure that we use existing, familiar implementations as much as possible. One theory as to why the |
RE CS1701: This warning is obsolete and shouldn't be reported at all. The script engine can suppress these warnings globally. |
Any news on this? This is super actionable as especially in the AI craze, there are a lot of prerelease packages from Microsoft, OpenAI and others, and every cell that uses anything from those packages currently needs to have the pragma warning disable. |
One approach that could work would be a magic command (e.g. something like |
When adding NuGet packages with common dependency but with different versions in a Jupyter notebook, compiler warning CS1701 occurs. To suppress this, each code cell needs
#pragma warning disable CS1701
. This becomes distracting when using a notebook as an interactive tutorial, so it would be great if suppression could be done globally - perhaps even a Directory.Build.props file in a parent or ancestor directory (like MSBuild project files). Or, at the very least, if a single#pragma
would disable a warning for all cells.An example of the error without the
#pragma
would be using the following in a code cell:The text was updated successfully, but these errors were encountered: