当前位置:网站首页>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 --prereleaseScript
在 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
边栏推荐
- [paper reading] Tun det: a novel network for meridian ultra sound nodule detection
- Get to know ROS for the first time
- P3304 [SDOI2013]直径(树的直径)
- TS quick start - functions
- 华为百万聘请数据治理专家!背后的千亿市场值得关注
- const、volatile和restrict的作用和用法总结
- Summer challenge brings you to play harmoniyos multi terminal piano performance
- leetcode518,377
- 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
- 兩個數相互替換
猜你喜欢

4. Scala writes HelloWorld in idea, in-depth analysis of accompanying objects, and association of source packages

7. Scala process control

XML的解析

Sorting selection sorting

Safety learning week4

华为200万年薪聘请数据治理专家!背后的千亿市场值得关注

“薪資倒掛”、“畢業生平替” 這些現象說明測試行業已經...

创新引领方向 华为智慧生活全场景新品齐发

ORB(Oriented FAST and Rotated BRIEF)

IT转测试岗,从迷茫到坚定我究竟付出了什么?
随机推荐
He worked as a foreign lead and paid off all the housing loans in a year
Relationship between classes and objects
Nine Qi single chip microcomputer ny8b062d single key control four LED States
Is it safe to open an account in the College of Finance and economics? How to open an account?
Safety learning week4
那些一门心思研究自动化测试的人,最后都怎样了?
Consolidated expression C case simple variable operation
npm install报错 强制安装
实战模拟│JWT 登录认证
Paper notes multi UAV collaborative monolithic slam
URL和URI
初识ROS
TS快速入门-函数
P3304 [sdoi2013] diameter (diameter of tree)
Basic concept and usage of redis
XML的解析
“薪资倒挂”、“毕业生平替” 这些现象说明测试行业已经...
Getting started with Paxos
GDB common commands
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