当前位置:网站首页>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
边栏推荐
- 2022.07.03(LC_6108_解密消息)
- Learning of basic amplification circuit
- 那些一门心思研究自动化测试的人,最后都怎样了?
- MySQL uses the explain tool to view the execution plan
- Daily practice (18): stack containing min function
- Multilingual Wikipedia website source code development part II
- [STM32] (I) overview and GPIO introduction
- NPM install error forced installation
- 2022.07.03 (lc_6111_counts the number of ways to place houses)
- Get to know ROS for the first time
猜你喜欢

【C】(笔试题)指针与数组,指针

Some basic functions of enterprise projects are developed, and important things are saved to online first a

Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system

Visual explanation of Newton iteration method

How to avoid arc generation—— Aafd fault arc detector solves the problem for you

Application of fire fighting system based on 3D GIS platform

兩個數相互替換
![[paper reading] cavemix: a simple data augmentation method for brain vision segmentation](/img/41/eb790e7419a158e985fa503bd7dc17.png)
[paper reading] cavemix: a simple data augmentation method for brain vision segmentation
![[selenium automation] common notes](/img/d3/6699792e85b5ee5a2d6192f4e4d07c.png)
[selenium automation] common notes

Huawei employs data management experts with an annual salary of 2million! The 100 billion market behind it deserves attention
随机推荐
Summer challenge brings you to play harmoniyos multi terminal piano performance
【路径规划】RRT增加动力模型进行轨迹规划
Summary of week 22-07-02
Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
Identifiers and keywords
Is it safe to open an account in the College of Finance and economics? How to open an account?
7. Scala process control
Relationship between classes and objects
Mongodb series learning notes tutorial summary
Get to know ROS for the first time
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
华为百万聘请数据治理专家!背后的千亿市场值得关注
Consolidated expression C case simple variable operation
lambda expressions
P3304 [SDOI2013]直径(树的直径)
Hologres Query管理及超时处理
URL和URI
PermissionError: [Errno 13] Permission denied: ‘data. csv‘
2022.07.03 (LC 6108 decryption message)
Design of emergency lighting evacuation indication system for urban rail transit station