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