File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 99 "args" : [
1010 " exec" ,
1111 // change to your own folder
12- " C:/Users/heartacker /.dotnet/tools/.store/dotnet-script/1.4.0/dotnet-script/1.4.0/tools/net7.0/any/dotnet-script.dll" ,
12+ " ${userHome} /.dotnet/tools/.store/dotnet-script/1.4.0/dotnet-script/1.4.0/tools/net7.0/any/dotnet-script.dll" ,
1313 " ${file}"
1414 ],
1515 "cwd" : " ${workspaceRoot}" ,
Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ using Microsoft.CodeAnalysis.CSharp.Scripting;
1010using Microsoft . CodeAnalysis . CSharp . Syntax ;
1111using System . IO ;
1212
13+ var so = ScriptOptions . Default . WithImports ( "System.IO" ) ;
14+ so . WithImports ( "System" ) ;
1315Console . WriteLine ( @"测试输入输出函数:Directory.GetCurrentDirectory()" ) ;
14- var res = await CSharpScript . EvaluateAsync ( "Directory.GetCurrentDirectory()" ,
15- ScriptOptions . Default . WithImports ( "System.IO" ) ) ;
16+ var res = await CSharpScript . EvaluateAsync ( @"
17+ using System;
18+ Console.WriteLine(10086);
19+ Directory.GetCurrentDirectory()" , so ) ; // *if end with ; no return value
1620Console . WriteLine ( res ) ;
1721
1822
You can’t perform that action at this time.
0 commit comments