做五金外贸哪个网站比较好,鄱阳做网站,兰州网站建设q479185700強,网站建设的可行性分析dotnet-exec 0.5.0 releasedIntrodotnet-exec 是一个 C# 程序的小工具#xff0c;可以用来运行一些简单的 C# 程序而无需创建项目文件#xff0c;而且可以自定义项目的入口方法#xff0c;支持但不限于 Main 方法Install/Updatedotnet-exec 是一个 dotnet tool#xff0c;可… dotnet-exec 0.5.0 releasedIntrodotnet-exec 是一个 C# 程序的小工具可以用来运行一些简单的 C# 程序而无需创建项目文件而且可以自定义项目的入口方法支持但不限于 Main 方法Install/Updatedotnet-exec 是一个 dotnet tool可以使用安装 dotnet tool 的命令来安装安装/更新最新稳定版本dotnet tool update -g dotnet-execute安装最新的 preview 版本dotnet tool update -g dotnet-execute --prereleaseUpdatesFeaturesCustom references在 0.5.0 版本中用户可以自定义 reference你可以使用 -r/--reference 选项来自定义引用的本地的 dll 或者 nuget 包比如说下面这个引用 nuget 包的示例dotnet-exec code:typeof(CsvHelper).Assembly.Location.Dump() -r nuget:WeihanLi.Npoi -u WeihanLi.Npoi这里引用了 WeihanLi.Npoi 这个 nuget 包没有指定版本的时候默认使用最新的稳定版本目前是 2.3.0 所以我们看到的输出结果会是 2.3.0我们也可以指定具体的 NuGet 包版本比如dotnet-exec code:typeof(CsvHelper).Assembly.Location.Dump() -r nuget:WeihanLi.Npoi,2.1.0 -u WeihanLi.Npoi我们也可以直接引用本地的 dll比如我们引用上面 nuget 包中的本地 dlldotnet-exec code:typeof(CsvHelper).FullName.Dump() -r C:\Users\Weiha\.nuget\packages\weihanli.npoi\2.3.0\lib/net6.0/WeihanLi.Npoi.dll -u WeihanLi.NpoiDocker support enhancements如果你不是 dotnet 开发者或者不想安装 dotnet 环境你也可以使用 docker 来尝试它docker run --rm weihanli/dotnet-exec:0.5.0 dotnet-exec code:(11).Dump()之前 docker 镜像是基于 SDK 的镜像来打包的镜像比较大0.5.0 版本开始使用 runtime 镜像来打包比原来的镜像小了很多对比 dockerhub 上镜像大小可以发现比原来的镜像大小减少了大概 70%可以参考https://hub.docker.com/r/weihanli/dotnet-exec/tagsruntime 包中只包含了 runtime 程序集不包含引用程序集在编译的时候会使用引用程序集没有 SDK 本地也就没有了引用程序集会 fallback 到 nuget 包为了减少第一次运行时的等待时间这里有一个比较 tricky 的做法在 Dockerfile 的最后运行了一个 dotnet-exec code:Hello .NET.Dump() 来下载 .NET 框架的引用程序集这样相同的 .NET 版本就不需要再下载了可以减少一些下载 NuGet 包和与 NuGet 服务器交互的时间从而减少一些启动时间Referenceshttps://github.com/WeihanLi/dotnet-exechttps://www.nuget.org/packages/dotnet-execute/https://hub.docker.com/r/weihanli/dotnet-exec