scriptcs

ScriptCS 0.17.01 Error Unexpected named argument

北慕城南 提交于 2021-02-19 03:39:38
问题 I tried to run my program using Visual Studio's Coderunner extension as well as from terminal with the scriptcs command. My code is as follows: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } } } The error message reads: Unexpected named argument: Users/jfitz/Projects/C#/Projtest/test.cs 回答1: As mentioned in scriptcs/scriptcs issue 1188, this is from a scriptcs bug, which will be fixed in the next release

scriptcs - Unable to read package

∥☆過路亽.° 提交于 2020-01-14 14:33:55
问题 I followed a blog post to get scriptcs running in just two steps. Basically, I did this: @powershell -NoProfile -ExecutionPolicy Unrestricted -Command "iex ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin And then I got an error when doing this: cinst scriptcs Unable to read package from path 'jQuery.2.0.1.1.nupkg'. This worked on a different machine, but it's failing on my current laptop. Any idea what I'm

scriptcs - Unable to read package

那年仲夏 提交于 2020-01-14 14:33:49
问题 I followed a blog post to get scriptcs running in just two steps. Basically, I did this: @powershell -NoProfile -ExecutionPolicy Unrestricted -Command "iex ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin And then I got an error when doing this: cinst scriptcs Unable to read package from path 'jQuery.2.0.1.1.nupkg'. This worked on a different machine, but it's failing on my current laptop. Any idea what I'm

Why doesn't Console.WriteLine work in Visual Studio Code?

元气小坏坏 提交于 2019-12-21 09:21:21
问题 I have scriptcs and coderunner installed on Visual Studio Code. When I run a simple program that includes Console.WriteLine("Test") I don't see any output. The program seems to run successfully and exits with code 0. Any suggestions? Here's all the code in case anyone is interested: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { Console.WriteLine("Test"); } } 回答1: If you are

How to define an extension method in a scriptcs csx script

拥有回忆 提交于 2019-12-18 18:53:21
问题 I'm playing with ScriptCS (which is awesome!) but I couldn't figure out how to define an extension method within a .csx script file . Take this example: using System.IO; public static class Extensions { public static string Remove(this string source, params string[] toRemove) { foreach(var r in toRemove) { source = source.Replace(r,""); } return source; } } string[] entries = Directory .GetFiles( @"C:\Users\blah\blah", "*.mp4", SearchOption.AllDirectories) .Select( p => p.Remove("Users"))

scriptcs Mixed mode assembly error

本小妞迷上赌 提交于 2019-12-12 03:37:44
问题 I have added an application in scriptcs and added some references to assemblies which have the version v2.0.50727. So while running the scriptcs file it returns as Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime.Setting attribute useLegacyV2RuntimeActivationPolicy="true" in app.config may resolve the issue in asp.net web application. but in scriptcs its not working. further searching reveals that above attribbute

Getting error: /bin/sh scriptcs: command not found

与世无争的帅哥 提交于 2019-12-04 11:19:32
问题 I'm using Visual Studio Code for Mac, running extension CodeRunner. I've got a simple program: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } } } When I run it using the play button in the upper right hand corner I get the following error: /bin/sh scriptcs: command not found Then [Done] exited with code=127 in 0.008 seconds The program does not show the desired output. EDIT: Much thanks to @VonC. His

Why doesn't Console.WriteLine work in Visual Studio Code?

徘徊边缘 提交于 2019-12-04 03:07:23
I have scriptcs and coderunner installed on Visual Studio Code. When I run a simple program that includes Console.WriteLine("Test") I don't see any output. The program seems to run successfully and exits with code 0. Any suggestions? Here's all the code in case anyone is interested: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { Console.WriteLine("Test"); } } If you are just trying to run a cs file without a project etc then the problem is that code runner is treating the file

Getting error: /bin/sh scriptcs: command not found

依然范特西╮ 提交于 2019-12-03 06:55:19
I'm using Visual Studio Code for Mac, running extension CodeRunner. I've got a simple program: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } } } When I run it using the play button in the upper right hand corner I get the following error: /bin/sh scriptcs: command not found Then [Done] exited with code=127 in 0.008 seconds The program does not show the desired output. EDIT: Much thanks to @VonC. His approach worked. Pro tip for anyone: install scriptcs using brew install scriptcs Considering the

How to define an extension method in a scriptcs csx script

不问归期 提交于 2019-11-30 17:29:47
I'm playing with ScriptCS (which is awesome!) but I couldn't figure out how to define an extension method within a .csx script file . Take this example: using System.IO; public static class Extensions { public static string Remove(this string source, params string[] toRemove) { foreach(var r in toRemove) { source = source.Replace(r,""); } return source; } } string[] entries = Directory .GetFiles( @"C:\Users\blah\blah", "*.mp4", SearchOption.AllDirectories) .Select( p => p.Remove("Users")) .ToArray(); foreach(var e in entries) { Console.WriteLine(e); } This yields the error: error CS1109: