问题标签 [dotnet-script]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
248 浏览

c# - “dotnet 脚本”(csx)是否支持 ASP.NET Core 应用程序开发?

我正在查看此处提供的“dotnet 脚本”(csx):https ://github.com/filipw/dotnet-script

我能够让基本示例正常工作。但是,我正在尝试使用“dotnet script”(仅使用纯 csx)检查 ASP.NET Core 的可能性。

主.csx:

启动.csx:

我遇到以下错误:

知道我做错了什么吗?

谢谢。

0 投票
1 回答
188 浏览

c# - 使用 .NET Core 3.1 运行 C# 脚本时出现 FileLoadException

我编写了以下 C# 脚本(HelloWorld.csx 文件):

我正在使用dotnet-script(1.0.1 版)和.NET 运行时(3.1.14 版)

执行此脚本时,出现以下错误。知道为什么吗?

System.IO.FileLoadException:无法加载文件或程序集“System.Text.Encoding.CodePages,版本=5.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a”。无法找到或加载特定文件。(0x80131621) 文件名:'System.Text.Encoding.CodePages,版本=5.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a'---> System.IO.FileLoadException:无法加载文件或程序集'System.Text。 Encoding.CodePages,版本=5.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a'。在 System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly) 在 System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) 在 System.Reflection.Assembly.LoadFrom(String assemblyFile) 在System.Reflection.Assembly。

0 投票
0 回答
31 浏览

.net-core - 无法将 switch 表达式与 dotnet-script 一起使用

Dotnet-script 不能使用从 C#8.0 添加的 switch 表达式。是规范吗?

dotnet-script.exe --info 版本:1.1.0 目标框架:net5.0 .NET Core 版本:5.0.7 平台标识符:win 运行时标识符:win10-x64

写代码

返回