Releases: tareqimbasher/NetPad
NetPad v0.7.0
Preview 7
This release brings support for ASP.NET, scaffolding control, new Dump() capabilities and more!
If you like NetPad, please star the repo π!
What's New π
ASP.NET Support
Open script properties (F4) and check Reference ASP.NET on the bottom left to Add ASP.NET to your script and get a web app running in seconds!
Compiler Optimizations
Select to enable or disable compiler optimizations.
Preprocessor Directives
A few C# preprocessor directives are now available.
Database Connections
Connection String
You can now manually edit the connection string.
Scaffolding Options
New options were added to give you more control over the scaffolding process.
Entity Framework Logs
The SQL tab now shows all Entity Framework logs, with colors, and provides a dropdown to filter them by category.
Override OnConfiguring
NetPad overrides the OnConfiguring method on the base DbContext to forward Entity Framework logs to the SQL tab. This means you can't override it yourself. To get around that, a new OnConfiguringPartial method is introduced and can be used like so:
partial void OnConfiguringPartial(DbContextOptionsBuilder optionsBuilder)
{
// Your code
}Its not as pretty π but a better solution is available and will be implemented in a future release.
Dump()
Enhancements
This update adds the ability to dump the following objects types:
- Dumping media files (using the new
Image,AudioandVideoclasses in theNetPad.Medianamespace) will render them as media content the output pane. - Dumping
JsonDocument,JsonElementandJsonNodewill output their JSON representation. - Dumping
XmlNode,XNodeand other related types inSystem.XmlandSystem.Xml.Linqnamespaces respectively will output their XML representation.
Additional Parameters
These new optional parameters were added to the Dump() method:
css: (string) css classes to add to output. You can use any Bootstrap v5 classes. Support for defining your own classes that you can use with this parameter is coming soon.clear: (int) will clear dumped result after specified milliseconds.code: (string) dump a code string with syntax highlighting.
See wiki for more details.
HTML Rendering (experimental)
Added basic support for HTML rendering. You can now Dump() HTML (and JavaScript!) and see it rendered in the output pane.
See wiki for examples. More documentation and examples are being added to better demonstrate usage.
Others
- Compiled script assemblies now have the fixed name "NetPadScript" which allows you to make the internals of your own assemblies visible to your NetPad scripts like:
[InternalsVisibleTo("NetPadScript")](#157) - New
flatpakandsnappackages [untested] - Slightly reduced bundle size.
Fixes π
- When you switch to a tab that is in the tab bar overflow, it is brought into view.
- Fixed an issue with running some SQL scripts when there is a
"in the query. - Fixed failure installing NuGet packages on non-English locales (#148).
- NetPad will now fallback to AppData folder as the "Scripts folder" if
USERPROFILE/Documentsis not writeable (#134). - Fixed NetPad not launching properly when user has the
DOTNET_ENVIRONMENTorASPNETCORE_ENVIRONMENTglobal variable set toDevelopment.
Sponsors β€οΈ
Thank you to my sponsors. Your support is greatly appreciated and helps keep this project growing!
If you're enjoying NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you π
Full Changelog: v0.6.1...v0.7.0
NetPad v0.6.1
Preview 6.1
This update brings a number of fixes and adds a few QoL improvements. Exciting new features are coming soon in v0.7.0!
If you like NetPad, please star the repo π!
What's New π
- Restore Last Active Script on Launch: When NetPad is launched, it will open to the last active script from the previous session.
- Restore Window Size & Position: NetPad will try to restore the previous size and position of its window at launch (#122).
- NuGet Package Manager is cleaner with a number of UX improvements and package loading/searching is much faster now. Also:
- The latest version of a package appears next to outdated packages in local cache.
- The version picker is now sensitive to the
Include Pre-releasescheckbox. - Dependencies shown in the details pane (far right column) are now easier to visually inspect.
- Reduced the prominence of the orange
PRODUCTIONbanner that appears on the left side of the editor when targeting a production database connection. Its now more subtle and less distracting.
Fixes π
- Better modal window sizing and placement.
- Fixed output font not switching to
monospacewhen selected in Settings. - Fixed #118: incorrect newline formatting
- Fixed #125: Main menu becoming empty when opening a dialog window
- Fixed bug when running script in .NET 6
- Fixed not auto-adding
usingstatement to Namespaces in some cases - Fixed C# language features not updating properly when a namespace is added in some cases
- Fixed Browse File input control not showing when adding/managing SQLite connections
- Fixed code completion suggestion menu getting cut off by Output pane
- Fixed bad NuGet search results when changing the number of items to show per search result page.
β€οΈ If you're enjoying NetPad, please consider sponsoring it. Thank you π
Full Changelog: v0.5.1...v0.6.0
NetPad v0.6.0
Preview 6
This release brings support for .NET 8 and C# 12, Native windows decorations and other new features!
If you like NetPad, please star the repo π!
What New π
- .NET 8 & C# 12 Support
- Edit Keyboard Shortcuts: You can edit (some) keyboard shortcuts in
Settings. - Native Windows: Its now possible to switch to use Native window decorations (frame, titlebar..etc) (see #82). You can choose between the following settings:
- Integrated: Frameless window, and the titlebar NetPad has had so far. It merges the main menu and the titlebar (default for Windows/Linux).
- Native: Uses the OS-native window frame and titlebar (default for macOS).
- Window Controls Position: (When using the Integrated titlebar only) You can chose to position the minimize, maximize, and close window controls to the right side of the titlebar, or the left.
- Right (default)
- Left
- Main Menu Auto-Hide: (Has no effect on macOS when using the Native titlebar)
- Always Show (default)
- Auto-Hide
- Allow
unsafeCode: Theunsafekeyword is now allowed in C# scripts. There is no setting to turn this off. If this is something you guys would like to see become configurable, be sure to open a discussion or issue! - Optimizations to script output rendering which also solves an issue with output buffer not allowing a script to stop (#98). These optimizations include limiting the maximum items (individual
Dump()orConsole.Writecalls) one can output to 10,000 items in a single run. - Other Changes:
- Scripts that are using a data connection will display a database icon (will be orange for production connections) in their tabs for more visibility when editing other scripts.
Dump()will now exclude base properties that are hidden by properties in derived types.- Line numbers shown in compilation errors or in uncaught exception stack traces will now show the correct line numbers.
- Updates OmniSharp Roslyn to v1.39.10
Fixes π
- Fixed completions not showing when trigger char (
.) is typed. Thank you DoodleBop over on Discord for the help on this. - Disabled the auto show/hide of nav controls in the Output pane. It was buggy and resulted in sometimes hiding and not showing the nav controls until all output is rendered, disabled until it is properly fixed.
- Disallow selecting a database file from disk except on SQLite connections
Sponsors β€οΈ
Thank you to my sponsors. Your support is greatly appreciated and helps keep this project growing!
If you're enjoying NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you π
Full Changelog: v0.5.1...v0.6.0
NetPad v0.5.1
If you like NetPad, please star the repo π!
Preview 5.1
This is a hotfix for v0.5.0. New features are coming soon!
Fixes π
- Fixes OmniSharp features (ex. Auto-Complete, Syntax Highlighting...etc) not starting on new installs (#92)
- Fixes possible issue with names of newly created scripts
Support
If you're enjoying NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you π
Full Changelog: v0.5.0...v0.5.1
NetPad v0.5.0
If you like NetPad, please star the repo π!
Preview 5
This release adds a number of great new features, checking off some more items from our roadmap!
What New π
- SQLite support: You can now add connections to SQLite databases!
- Connection Schema Caching: NetPad will now cache the generated
DbContextfor a database and reuse it the next time you fire it up. Changes to the schema will be detected automatically and the cache will be refreshed.- Schema change detection happens the first time you use a connection after starting NetPad.
- You can still choose to refresh the connection manually.
- More information about how this works can be found here.
- Drag & Drop a Connection to the editor to assign that connection to the active script.
- Editor Enhancements:
- Go-to Symbol (shortcut: Ctrl + Shift + O, and is accessible in right-click menu)
- Rename Symbol (shortcut: F2, and is accessible in right-click menu)
- Format Selection (shortcut: Ctrl + K Ctrl + F, and is accessible in right-click menu)
- Auto Format while Typing
- Contextual Code Folding: Code folding is now much smarter and aware of code context.
- Rename a script by right-clicking a script tab. Thank you @jwallet for this contribution.
- Duplicate a script by right-clicking a script tab. Thank you @jwallet for this contribution.
- Full Screen Support: You can now switch to full-screen view (shortcut: F11). This can also be activated in the main menu
View > Full Screen. - A new Wiki: NetPad has a wiki now, check it out! It still needs more love, but it already has some useful info.
Fixes π
- Fixed (#78) an issue on some macOS setups where the EF Core tool would fail to run.
Sponsors β€οΈ
A LOUD shout out to my new and existing contributors! Your support is so very greatly appreciated! Your contributions go directly towards adding new features, enhancing existing ones and have a direct impact on advancing this project forward. You are superstars, thank you!
β Hamed Imbasher
β Luke Preiner
β Matt J Cowan
If you're enjoying NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you π
Full Changelog: v0.4.2...v0.5.0
NetPad v0.4.2
If you like NetPad, please star the repo π!
Preview 4.2
This is a hotfix release that makes the following changes:
- Fixes (#69) where using Microsoft SQL Server connections would fail on macOS
- Fixes (#70) where
DbContextcompilation would fail if scaffoldedDbSettype is the same as its property name. Thank you @jwallet for contributing the fix - Hides overflow in statusbar that would appear in some cases
- Adds a blackground color to a data connection when right-clicked to make it easier to identify
A new release will be coming soon with new features!
Contributors β€οΈ
A LOUD shout out to my new and existing contributors! Your support is so very greatly appreciated! Your contributions go directly to adding new features, enhancing existing ones and have a direct impact on advancing this project forward. You are superstars, thank you!
β Hamed Imbasher
β Francesco Bonizzi
β Luke Preiner
β Matt J Cowan
If you're enjoying NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you π
Full Changelog: v0.4.1...v0.4.2
NetPad v0.4.1
If you like NetPad, please star the repo π!
Preview 4.1
This release adds a few new features and improvements, and fixes reported issues.
What New π
- New Icon Color Theme ποΈ: A new "Colorful" icon color theme was added. You can switch to it in
Settings > General. - Scroll on Output: Adds a new icon to the Output pane that when enabled will scroll output view as new output is rendered. This is useful when you want to follow the latest output without having to continuously scroll.
- Output Pane Shortcut: You can now use Ctrl + R to toggle open the Output pane. Window reload shortcut moved to Ctrl + Shift + R
- New Main Menu Items:
Edit > Settings: Opens the settings window (shortcut: F12).Edit > Transform to Upper/Lower Case: Transforms selected text to upper or lower case (shortcut: Ctrl + Shift + Y).View > Output: Toggles the Output pane (shortcut: Ctrl + R)View > Explorer: Toggles the Explorer pane (shortcut: Alt + E)View > Namespaces: Toggles the Namespaces pane (shortcut: Alt + N)
- Dump():
- Better support for dumping
FileInfoandDirectoryInfoobjects - Support dumping
Memory<T>andReadOnlyMemory<T>objects - Support dumping
Span<T>andReadOnlySpan<T>values. However this only works if directly dumping a Span. If Span is not the root object being dumped, only basic info about the Span is rendered. - Adds a
MaxDepthto serialization. Defaults to 64, has a min value of 1 and max value of 1000. A new user setting was added and can be configured inSettings > Results. - A new user setting was added to configure
MaxCollectionSerializeLengthwhich defines how many items of a collection should be serialized. This was previously hard-coded to 1000. Defaults to 1000, has a min value of 1 and max value of 10,000.- Warning: Increasing this setting too high might cause performance issues in rendering results.
- Better support for dumping
- Other changes:
- Reduced SPA bundle size by 33%.
- New Output pane icon!
- Removed the word "Output" from the Output pane header
- A more subtle border for Output navigation arrows.
- Add just a bit more height and padding to the Compact style.
Fixes π
- Check that the version of EF Tool is supported (v5 or higher) and not just that it is installed.
- Stops a running script if it is closed while it is still executing.
- Fix output of unhandled exceptions so that it is formatted correctly, shows new lines correctly, and renders Stack Trace lines in order.
- Fix bug that would occur occasionally complaining about a dictionary key already existing when generating script output.
- Fix cyclic reference detection in output for C#
records; was using default (value) comparison, now uses reference comparison. - Fix disabled textbox in
Settings > OmniSharp > Custom executable path. - Fix app crashing when large amounts of error output is generated very quickly (ex: stack overflow in a script).
Contributors β€οΈ
A LOUD shout out to my new contributors! Your support is so very greatly appreciated! Your contributions go directly to adding new features, enhancing existing ones and have a direct impact on advancing this project forward. You are superstars, thank you!
β Hamed Imbasher
β Francesco Bonizzi
If you're enjoying NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you π
Full Changelog: v0.4.0...v0.4.1
NetPad v0.4.0
If you like NetPad, please star the repo π!
Preview 4
This release mainly focused on adding .NET 7 support and the ability to write SQL scripts!
What New π
- .NET 7 support: You can now choose the .NET SDK your script will use between .NET 6 or .NET 7.
- βΉοΈ You need at least one of those 2 .NET SDK installed (You can only switch to a .NET SDK if you have it installed).
- Removed the dependency on specifically having .NET 6 SDK installed. So you don't need the .NET 6 SDK installed anymore if you don't want to run your scripts using .NET 6.
- Refactored this piece so that future .NET versions can be added much more quickly.
- SQL Support: You can now switch your script to use SQL language instead of C# and query your database using SQL with multiple result set support!
- Editor enhancements:
- Bracket pair colorization.
- CodeActions (the π‘) suggestions are now categorized and got some styling fixes.
- New OmniSharp integration: Document Highlighting.
- Double-clicking an inlay hint will insert the hint into the editor.
- Inlay hints styling changes to make them more easy on the eyes.
- Documentation popups are now syntax highlighted.
- Snippet completion suggestions are now sorted higher than their keyword counterparts. For example, suggestions for the word
forwill prioritize the snippetfor, effectively inserting aforloop, instead of the suggestion of the keywordforwhich just inserts the keyword itself. - Data Connection window had a small redesign and now shows the ConnectionString that will be used for the connection.
- Spashscreen Logo is smaller. The older, larger one, was a bit too much π
Fixes π
- Fixed an issue with Scripts sidebar not reflecting correct script file structure after moving scripts to sub-folder.
- Fixed an issue where selecting certain snippets from completion suggestions would insert erroneous characters along with the snippet text. Example:
override ToString().
Full Changelog: v0.3.1...v0.4.0
NetPad v0.3.1
If you like NetPad, please star the repo π!
Preview 3.1
β [EDIT] June 26, 2023: The macOS ARM build was updated.
Previous binary had an issue where it would not open, and instead would hang on the splash screen indefinitely requiring user to force quit the app. Please use the latest macOS ARM binary.
If you get the error: NetPad is damaged and can't be opened. You should move it to the Trash:
open a terminal and do this:
sudo xattr -cr /path/to/NetPad.appThis occurs because NetPad is not signed; macOS will only allow signed apps or apps downloaded from the App Store to run.
This release mainly focused on adding native support for macOS ARM (Apple Silicon). New macOS ARM specific builds are now available!
What New π
- A new setting was added for user to manually configure .NET SDK installation path. This can be found in
Settings > General- This setting is optional. If this value is not set, NetPad will scan and try to locate the .NET SDK installation path.
- An icon will show in the title bar when a new update is available instead of auto-opening the update dialog whenever a new update becomes available, which was a bit too intrusive.
- New "Update" and "Add Database Connection" icons
- Fixes .NET SDK auto-discovery on macOS ARM
Full Changelog: v0.3.0...v0.3.1
NetPad v0.3.0
If you like NetPad, please star the repo π!
Preview 3
This is the third pre-release! This release focused on introducing features to enhance script results and related functionality. Please open an issue for any bugs or feature requests. Your feedback on issues or suggestions is greatly appreciated!
What's New π
Results
- A new Format dropdown was added to the results view with the ability to expand and collapse results to specific levels
- A new Export dropdown was also added to the results view that you can use to export results to Excel or HTML
- Adds navigation controls in the results view to make it easier to scroll to the top of the large results element you're viewing, to the next or previous element, or to top or bottom of the results view.
- Added support for Dumping more complex object types:
- Tuples
- 2-D arrays are now displayed as a 2-D table
DataTableDataSetXDocument,XElement,XNode...etcXmlDocument,XmlNode...etc- Types that implement
IFormattableare now represented as astring
- Minor adjustments to results styling to make some things easier to read and focus on
Application
- A new "Go to Script" feature to quickly and easily get to any script you have open or that you've saved to your library. This can be activated using
Ctrl + T - You can now use
Console.ReadLine()in a script to ask user for input - NetPad now auto-checks for updates on startup. You can disable this in Settings. It does not yet auto-install the latest update for you, but it notifies you as soon as a new version is released and gives you an easy button to click to download the latest version.
What's Next π§
There are a number of features we still need to make NetPad viable for as many developers as possible. For the next release however, focus will be on providing .NET 7 support and adding more database providers.
Full Changelog: v0.2.0...v0.3.0







