如何开发软件?,网站推广seo招聘,做设计参考的网站,合肥seo网络优化公司dotnet-exec 0.12.0 releasedIntrodotnet-exec 是一个 C# 程序的小工具#xff0c;可以用来运行一些简单的 C# 程序而无需创建项目文件#xff0c;让 C# 像 python/nodejs 一样简单#xff0c;而且可以自定义项目的入口方法#xff0c;支持但不限于 Main 方法。Install/Upd…dotnet-exec 0.12.0 releasedIntrodotnet-exec 是一个 C# 程序的小工具可以用来运行一些简单的 C# 程序而无需创建项目文件让 C# 像 python/nodejs 一样简单而且可以自定义项目的入口方法支持但不限于 Main 方法。Install/Updatedotnet-exec 是一个 dotnet tool可以使用安装 dotnet tool 的命令来安装安装/更新最新稳定版本dotnet tool update -g dotnet-execute安装最新的 preview 版本dotnet tool update -g dotnet-execute --prerelease执行 dotnet-exec -h 或者 dotnet-exec --help 即可看到一些使用说明help textFeaturesConfig profile在这个版本中我们加入了一个 config profile 的功能我们可以将常用的选项配置保存到一个 profile 中这样我们就可以直接重用 profile 就可以了就不需要每次都用我们可以使用 dotnet-exec profile --help 查看使用帮助可以使用 ls 命令列出所有的 profilesdotnet-exec profile ls使用 get 命令获取 profile 的详细配置dotnet-exec profile get web使用 set 命令来配置 profile 对应的配置dotnet-exec profile set web -r nuget:WeihanLi.Web.Extensions -u WeihanLi.Web.Extensions --web --wide false使用 rm 命令来删除某一个 profile 的配置dotnet-exec profile rm web在执行代码的时候可以通过 --profile 指定要使用的 profile 配置也可以额外补充 using 以及 reference 信息也可以移除 profile 中的某一个 using 或者 referencedotnet-exec WebApplication.Create().Chain(__.MapRuntimeInfo()).Run(); --profile web --using WeihanLi.ExtensionsAdditional script for scripts在之前版本中增加了对代码的依赖支持但是script 的漏掉了在这个版本中补充了上去一个简单的示例如下需要注意的是 script 的依赖也是script代码有一些特殊不能包含命名空间声明的操作否则会报错Gitee url transform在之前的版本中我们已经添加了对于 github 和 gist 的支持在这个版本中增加了对 gitee 的支持在请求 https://gitee.com/weihanli/storage/blob/master/test/test.cs 的时候会自动转换成 https://gitee.com/weihanli/storage/raw/master/test/test.cs执行结果如下Reference Using enhancements在之前的版本中我们不支持 reference 的 remove添加了 profile 功能之后有些 reference 可能会希望执行的时候移除掉所以在新的版本中支持了 reference 的 remove移除的时候和 using 类似以 - 开头即可另外移除的优先级比较高如果既有添加又有移除最终会被移除示例如下移除 usingremoving using移除 reference在新的版本中支持了从 project file 解析 project 引用但只支持本地的 project file远程的 project file 不支持因为要 build 项目项目不在本地无法进行 build另外改进了一下 framework reference针对某个 framework 的引用会自动尝试加载隐式命名空间引用通过 framework reference 的形式来跑一个 web api这等于是直接使用 --web 选项dotnet-exec WebApplication.Create().Run(); --reference framework:web我们给 asp.net core web 框架加了几个别名可以根据自己需要选择目前支持的有 web/aspnet/aspnetcore再来看一下 WindowsDesktop 的框架引用示例More.NET Conf China 2022 release~~Referenceshttps://github.com/WeihanLi/dotnet-exechttps://www.nuget.org/packages/dotnet-execute/https://hub.docker.com/r/weihanli/dotnet-exechttps://github.com/WeihanLi/dotnet-exec/compare/0.11.0...0.12.0