Releases: tareqimbasher/NetPad
NetPad v0.9.1
Fixes π
- Fixes an error when running .NET 9 scripts targeting PostgreSQL and MySQL connections.
- Failure to load database structure tree in sidebar in some cases.
- Added missing
.deb
package .
See Releases for features added in v0.9.0.
Installers
NetPad comes in 2 flavors:
- Electron: Installers that start with
netpad
- Native Shell: Installers that start with
netpad_vnext
Both flavors have the same feature set. The native vNext version is lighter on system resources and will eventually become the main package. At which point, the Electron version will be deprecated.
Full Changelog: v0.9.0...v0.9.1
NetPad v0.9.0
Its been a while since the last release; war affects us all unfortunately.
Until now, packaging binaries for every supported platform was done manually. It was slow, error-prone and just no fun at all. We now have automated CD pipelines that makes it much easier. The plan is to have a more frequent release cycle. There are a lot of new improvements comingβstay tuned.
If you like NetPad, please star the repo π!
What's New π
Database Connection Query Speed
A main focus of this release was improving the user experience when running scripts with database connections (#196).
Prior to this release, scripts targeting a connection were slow to start, mainly due to Entity Framework's long startup
time. A new execution model was introduced so that this cost is only paid on the first run of a script, later runs will
be much faster even if your code changes.
How script execution works in NetPad
To improve performance and enable advanced features, NetPad uses a background process called script-host
. This process is launched once, per script, and reused across multiple script runs, reducing startup time after the first execution.
The script-host
also enables features like in-memory caching (introduced in this release) and lazy-loading of navigation properties in Dump
output (coming in the next version).
The script-host
process is automatically restarted in certain situations, including:
- When you manually stop a running script.
- When the .NET SDK version or selected database connection for a script changes.
- When dependencies are modifiedβfor example, after re-scaffolding a database connection.
In these cases, the next script run may take longer to start, but subsequent runs will be much faster.
Utility Helper
A handy new Util
class is now available (#166) to enhance your scripting experience with built-in helpers for
dumping data, caching, environment access, and more.
See the Util wiki page.
Caching
The Util
class has an in-memory Cache
property that can be used to store data and then access it in later script
runs. Example:
var albums = Util.Cache.GetOrAdd("albums", () => Albums.ToArray());
var albums = await Util.Cache.GetOrAddAsync("albums", () => await Albums.ToArrayAsync());
MemCache Pane
A new pane called MemCache
will now appear on the right side of the interface, displaying the values you've cached
in code. Clicking an item in this pane will dump it to the output pane. Hover over an item to see more info.
User Interface
Various UI improvements for better usability, clearer visuals, and more intuitive interactions across the app.
- The Save icon now shows an indicator when a script has unsaved changes, and is disabled when not needed.
- The Namespaces pane textbox has improved styling and a new icon.
- The selected editor tab is now more visually distinct.
- Icon colors have been subtly refined for better consistency.
- Pane dividers now show clearer drag handles on hover.
- The Scripts Explorer displays the number of scripts in each folder.
- You can now switch the layout direction of the Explorer pane.
- Status messages in the status bar can be dismissed with a right-click.
- Minor styling update to the "References" link in the editor.
- Two new menu items have been added to improve navigation and accessibility:
- Tools β A new top-level menu with some utilities and tools.
- Help > Wiki β A new submenu item that opens NetPad's wiki pages for quick access to documentation.
Status Visibility
Script status is now easier to see at a glance. Editor tabs display a colored line that indicates when a script is
running or stopping, helping you quickly spot active scripts across tabs.
I'm experimenting with this subtle visual cue and would love your feedbackβwould you prefer something more prominent,
like a colored status bar? Let me know what feels right to you.
The status bar at the bottom of the window also provides clearer, more informative messages about script activity.
Additionally, the timer on the far left has been improved: it now more accurately reflects the actual execution time
of your script, excluding setup overhead that was previously included.
Others
- Improved reliability of the "Stop Script" mechanism.
- Wrapped long documentation text in IntelliSense popups for better readability.
- New installations now default to colorful icons (
Settings > General > Icon Theme
). - Updated and expanded several Wiki pages.
Fixes π
- Fixes #280: Disappearing output when switching tabs.
- Fixes #287: Private NuGet sources breaking script execution.
- Fixes #296: Issue loading referenced assemblies.
- Fixes #301: User input textbox blocking output.
- Fixes for NetPad vNext not running on some setups.
- Reduce the instances where OmniSharp fails to provide syntax highlighting and intellisense.
- Fix syntax highlighting styles of dumped code strings.
- Fix some zoom menu items.
- Captures current code when user clicks Run to prevent further code edits from affecting current run.
- Other minor fixes and optimizations.
Installers
NetPad comes in 2 flavors:
- Electron: Installers that start with
netpad
- Native Shell: Installers that start with
netpad_vnext
Both flavors have the same feature set. The native vNext version is lighter on system resources and will eventually become the main package. At which point, the Electron version will be deprecated.
Support β€οΈ
If you're enjoying NetPad and would like to support open-source, please consider sponsoring the project, it really
helps! Also don't forget to star the repo if you haven't already, thank you!
A special thanks to all my sponsors. Your support is greatly appreciated and helps keep this project growing!
Full Changelog: v0.8.0...v0.9.0
NetPad v0.8.0
If you like NetPad, please star the repo π!
What's New π
New Database Connection Providers
You can now add MySQL and MariaDB connections in NetPad. Special thanks to @SimonNyvall!
A Native Shell (vNext Preview)
This update introduces a new native shell built using Tauri, a Rust-based framework, that greatly reduces memory usage, startup time, and app size!
The new shell substitutes the Electron.js shell NetPad has been using so far. You will find new installers available that use the new native shell with names starting with netpad_vnext
. Electron shell installers are still available, and will continue being distributed until things are stable with vNext. Both versions of NetPad can be installed and run side-by-side. It would be really helpful if you could please provide your feedback in an issue (if you're having trouble), in this discussion or on Discord.
If you'd like to read more about this change, take a look at this issue. Here are some stats:
App Size
Metric | Electron (MB) | Tauri (MB) | % Reduction |
---|---|---|---|
Shell Size | 251 | 13.6 | 94.58 |
.NET App Size | 192 | 103 | 46.35 |
Installer Size (.deb) | 125 | 43 | 65.60 |
Installed Size (.deb) | 443 | 111 | 74.94 |
Memory Usage
Metric | Electron (MB) | Tauri (MB) | % Reduction |
---|---|---|---|
Shell | 230 | 34 | 85.22 |
.NET App | 110 | 110 | -- |
OmniSharp | 104 | 104 | -- |
Total | 444 | 248 | 44.14 |
Known Limitations with vNext
- If you have your NetPad settings configured to use the native titlebar instead of the integrated one, menu auto-hide does not work yet (not an issue on macOS).
- The main window does not currently remember its previous position and size when you close and restart NetPad.
- The Electron version of NetPad will show you a desktop notification when a script finishes execution and NetPad is in the background. vNext currently does not.
- Some Linux installers are not yet available for vNext, namely:
pacman
,flatpak
andsnap
- If you're on Linux and when you launch the app you get an empty window, try disabling DMABUF:
export WEBKIT_DISABLE_DMABUF_RENDERER=1
. This is an upstream bug with NVIDIA proprietary drivers on some installations. If that doesn't work, try one of these instead:WEBKIT_DISABLE_COMPOSITING_MODE=1
__NV_PRIME_RENDER_OFFLOAD=1
Fixes for some or all of the above will be included in the next release.
Others
- Removed .NET 6 dependency: having a .NET 6 runtime or SDK installed is no longer required.
- If you want to use .NET 9 in your scripts you will need .NET 9 Preview 3 SDK or later installed.
- Improvements to data connection scaffolding.
- New scripts will use the latest stable .NET SDK. Previously the latest SDK was auto-selected regardless if it was stable or preview.
- New script names will use the next highest available number. Example: if you have "Script 1" and "Script 3" open, creating a new script will give it the name "Script 4". Before it was named "Script 2" which was confusing.
- Update OmniSharp Server to v1.39.12.
- More details are shown about errors that occur during scaffolding database connections.
- Minor styling changes:
- The
Production
marker in the connections list is right aligned and is now just the letterP
. - Fixed weird line at the top of the app logo.
- The
Fixes π
- Fixed Zoom menu items and their corresponding keyboard shortcuts
- Fixed an issue running scripts targeting SQLite connections on macOS
- Fixed writing
char
values to the console (#225) - Fixed incorrect latest version label in NuGet search window (#227)
- Fixed namespace collisions when referencing some NuGet packages (#246)
- Fixed NuGet search not working when user has an unreachable feed configued in
nuget.config
(#261)
Coming Soon π
We're currently working on fulfilling requests from the issue tracker as well as a few new features:
- A new CLI tool that you can use to run C# scripts from the command line.
- Faster database queries.
Support β€οΈ
If you're enjoying NetPad and would like to support open-source, please consider sponsoring the project, it really helps! Also don't forget to star the repo if you haven't already, thank you!
A special thanks to my current sponsors. Your support is greatly appreciated and helps keep this project growing!
Full Changelog: v0.7.2...v0.8.0
NetPad v0.7.2
If you like NetPad, please star the repo π!
What's New π
Syntax Tree Visualizer
A new "Code" pane was added with a Syntax Tree visualizer that updates in real-time as you type.
- Hovering over a node in the syntax tree will highlight that text range in the editor.
- Single-click a node to bring that code into view (if it isn't already).
- Double-click a node to select that text range in the editor. Focus switches to the editor when you do this so you can start typing right away.
- The right side shows the code each node in the tree represents, making it easier to quickly locate the code want you want to inspect.
- You can show the line/char span numbers each node represents by clicking the corresponding button in the Code pane toolbar.
Others
- Icon buttons styling improved and unified
- You can hide any pane with
Shift + ESC
keybinding - Output pane
- Empty collections are rendered a bit differently and other minor formatting changes to output
- Moved next/previous output nav controls to the toolbar in Results
- Added next/previous nav controls and clear button to the SQL toolbar
- You can switch to the Results and SQL tabs by using
ALT + 1
andALT + 2
respectively
Maintenance
The majority of the effort spent since the last release has been on restructuring the solution, simplifying and making it easier to maintain, review and contribute to. Another round is coming up soon, mainly on the client side, but the majority of it is completed. If you're interested in more info see #211.
I plan to add documentation soon that explains the high level concepts and structure of the solution to help facilitate review and contribution.
If anyone has any thoughts or discussion points I'd love to hear them. Feel free to open a discussion/issue on the topic or hit me up on Discord.
Fixes π
- Fixed a bug causing intellisense and other OmniSharp features to stop working if .NET 7 is not installed (#208, #214, #220)
- Fixed incorrect max-length input validation when changing max collection length to serialize in settings (#209)
- Fixed an error during HTML serialization (#217)
- Fixed bugs in
Console.ReadLine()
functionality including #218 - Fixed script not running when run path contains spaces (#221)
Support β€οΈ
If you're enjoying NetPad, please consider sponsoring it, it really helps! Also don't forget to start the repo if you haven't already, thank you!
A special thanks to my current sponsors. Your support is greatly appreciated and helps keep this project growing!
Full Changelog: v0.7.1...v0.7.2
NetPad v0.7.1
Preview 7.1
If you like NetPad, please star the repo π!
What's New π
.NET 9 Preview
Added support for .NET 9 Preview and Entity Framework Core 9 Preview 3.
Data Connections
Create Similar Connection
A new option now exists in the data connection context-menu to duplicate a connection.
Entity Framework Compiled Models
Entity Framework takes time to initialize on first use. The larger the data model, the more time it needs. For large models (100s or 1000s of entities and relationships) script startup can be sped up using a compiled model. An option to use a compiled model for a data connection now exists in Connection: Properties > Scaffolding
.
Note that using compiled models is not effective for smaller models, and comes with some limitations. It is recommended to only use this option if you need it.
Editor Styling
The editor has some pre-defined themes you can now pick from in Settings > Editor
. These themes come from the monaco-themes project.
Example, the GitHub Dark theme:
You can also tweak the current editor theme using the themeCustomizations
property in the Monaco options editor.
Example:
"themeCustomizations": {
// General editor colors
"colors": {
"editor.background": "#282a36"
},
// Semantic highlighting token styles
"rules": [
{
"token": "interface",
"foreground": "50fa7b",
"fontStyle": "underline"
}
]
}
See IColors and ITokenThemeRule for the definition of the
colors
andrules
properties respectively.
See wiki for more info.
App Styling
The new Settings > Styles
was added as a way to define custom styles that apply to the whole application.
For example to increase the font size of output:
.dump-container {
font-size: 1.25rem;
}
This feature also works great with the ability to specify CSS classes you want a dumped value to have, introduced in v0.7.0:
myObj.Dump(css: "important");
.important {
background-color: salmon;
}
You can also override CSS variables on the built-in theme-netpad-dark
and theme-netpad-light
themes. Here's an example customizing the dark theme with the Dracula theme color palette:
.theme-netpad-dark {
--drac-light: #343746;
--drac-dark: #22222c;
--text-color: #F8F8F2;
--background-color: var(--drac-dark);
--list-background: var(--drac-light);
--form-control-background-color: #343746;
--active-color: #dbb5fa;
--script-toolbar-background: #242632;
--pane-ribbon-background: var(--drac-light);
--pane-background: var(--drac-dark);
--pane-toolbar-background: var(--drac-dark);
--dialog-background: var(--drac-dark);
--tab-background: #333541;
--tab-active-background: #242632;
--tab-active-text-color: #fffff;
--scrollbar-thumb-color: #777777;
--splitter-color: #2b2d39;
}
See wiki for more info.
NuGet
NetPad will recognize additional NuGet sources added to your Nuget.Config
file (#119). Thank you @jsamse for that contribution.
There is no UI to manage NuGet sources in NetPad so far so you'll have to add them manually. More info
Media File Sizing
Media files will now be rendered in their original size, but you can also specify size using the DisplayWidth
and DisplayHeight
properties:
new Image("/path/to/img.png")
{
DisplayWidth = "128px",
DisplayHeight = "128px"
}.Dump();
Or using extension methods:
// Individually
Image.FromPath("/path/to/img.png")
.WithDisplayWidth("100%");
.WithDisplayHeight("400px");
// Together
Image.FromPath(imageFile).WithDisplaySize("100%", "400px");
See the wiki for more info.
Others
- An Apply button was added to the Settings window to apply changes without closing the window. Particularly useful when testing new styles!
- When a connection error occurs, clicking the error in the connection sidebar copies it to your clipboard (#171)
- Better
Settings > General > Appearance
layout - Upgraded OmniSharp server to v1.39.11
- Connections are now ordered alphabetically in the Explorer pane
Fixes π
- Fixed OmniSharp doc text showing up garbled for some non-English locales (#129).
- Fixed NetPad becoming unusable when clicking external links (#192).
- Fixed Select All (
CTRL+A
) in output pane selecting text outside its container (#178). - Fixed ASP.NET output not showing on Windows (#188).
- Fixed an issue when removing a NuGet package from a script.
- Fixed duplicate keyboard shortcuts showing up in
Settings > Keyboard Shortcuts
. - Fixed issue where
CTRL+F
in output pane would also open Find Text box in editor.
Full Changelog: v0.7.0...v0.7.1
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
,Audio
andVideo
classes in theNetPad.Media
namespace) will render them as media content the output pane. - Dumping
JsonDocument
,JsonElement
andJsonNode
will output their JSON representation. - Dumping
XmlNode
,XNode
and other related types inSystem.Xml
andSystem.Xml.Linq
namespaces 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
flatpak
andsnap
packages [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/Documents
is not writeable (#134). - Fixed NetPad not launching properly when user has the
DOTNET_ENVIRONMENT
orASPNETCORE_ENVIRONMENT
global 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-releases
checkbox. - Dependencies shown in the details pane (far right column) are now easier to visually inspect.
- Reduced the prominence of the orange
PRODUCTION
banner 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
monospace
when 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
using
statement 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
unsafe
Code: Theunsafe
keyword 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.Write
calls) 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
DbContext
for 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