当前位置:网站首页>dotnet-exec 0.6.0 released
dotnet-exec 0.6.0 released
2022-07-05 00:38:00 【dotNET跨平台】
dotnet-exec 0.6.0 released
Intro
dotnet-exec
是一个 C# 程序的小工具,可以用来运行一些简单的 C# 程序而无需创建项目文件,而且可以自定义项目的入口方法,支持但不限于 Main 方法
Install/Update
dotnet-exec
是一个 dotnet tool,可以使用安装 dotnet tool 的命令来安装
安装/更新最新稳定版本:
dotnet tool update -g dotnet-execute
安装最新的 preview 版本:
dotnet tool update -g dotnet-execute --prerelease
Script
在 0.6.0 版本中引入了 script 支持,从而简化一些简单的代码使用,比如说这个简单的例子
dotnet-exec "script:1+1"
在 0.5.0 版本中用户可以自定义 reference,现在你也可以针对 script 使用 -r
/--reference
选项来自定义引用的本地的 dll 或者 nuget 包
比如说下面这个引用 nuget 包的示例
dotnet-exec "script:typeof(CsvHelper).Assembly.Location" -r "nuget:WeihanLi.Npoi" -u "WeihanLi.Npoi"
这里引用了 WeihanLi.Npoi
这个 nuget 包,没有指定版本的时候默认使用最新的稳定版本,目前是 2.3.0 所以我们看到的输出结果会是 2.3.0
我们也可以指定具体的 NuGet 包版本,比如:
dotnet-exec "script:typeof(CsvHelper).Assembly.Location" -r "nuget:WeihanLi.Npoi,2.1.0" -u "WeihanLi.Npoi"
我们也可以直接引用本地的 dll,比如我们引用上面 nuget 包中的本地 dll
dotnet-exec "script:typeof(CsvHelper).FullName" -r "C:\Users\Weiha\.nuget\packages\weihanli.npoi\2.3.0\lib/net6.0/WeihanLi.Npoi.dll" -u "WeihanLi.Npoi"
新的 docker 镜像已经发布,也可以通过 docker 使用 weihanli/dotnet-exec:0.6.0 镜像来体验
References
https://github.com/WeihanLi/dotnet-exec
https://www.nuget.org/packages/dotnet-execute/
https://hub.docker.com/r/weihanli/dotnet-exec
边栏推荐
- [Yocto RM]10 - Images
- TS quick start - functions
- (脚本)一键部署redis任意版本 —— 筑梦之路
- MongoDB系列之学习笔记教程汇总
- A new method for analyzing the trend chart of London Silver
- [STM32] (I) overview and GPIO introduction
- 4. Scala writes HelloWorld in idea, in-depth analysis of accompanying objects, and association of source packages
- P4281 [ahoi2008] emergency assembly / gathering (LCA)
- Sorting selection sorting
- If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
猜你喜欢
程序员SQL数据脚本编码能力弱,BI做不出来怎么办?
Sorting selection sorting
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
Data on the number of functional divisions of national wetland parks in Qinghai Province, data on the distribution of wetlands and marshes across the country, and natural reserves in provinces, cities
[selenium automation] common notes
Date time type and format in MySQL
Leetcode70 (Advanced), 322
What did I pay for it transfer to testing post from confusion to firmness?
Two numbers replace each other
abc 258 G - Triangle(bitset)
随机推荐
Tester's algorithm interview question - find mode
It's too convenient. You can complete the code release and approval by nailing it!
4. Scala writes HelloWorld in idea, in-depth analysis of accompanying objects, and association of source packages
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
Huawei employs millions of data governance experts! The 100 billion market behind it deserves attention
Safety learning week4
Summer challenge brings you to play harmoniyos multi terminal piano performance
业务场景功能的继续修改
2022.07.03 (LC 6109 number of people who know secrets)
The difference between string STR and new string
Five papers recommended for the new development of convolutional neural network in deep learning
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
Les phénomènes de « salaire inversé » et de « remplacement des diplômés » indiquent que l'industrie des tests a...
MongoDB系列之学习笔记教程汇总
【C】(笔试题)指针与数组,指针
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
Is it safe to open and register new bonds? Is there any risk? Is it reliable?
Business implementation - the log is written to the same row of data
Basic concept and usage of redis
Distributed base theory