You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For C#, we need to use dotnet run --project to run a project (rather than a script). However, if we have to switch to the .csproj file directory to run it, it becomes less elegant. To address this, I modified the configuration by updating the path as follows:
"csharp": "cd $dir && cd \"..\" && for /f \"tokens=*\" %i in (\"%cd%\") do dotnet run --project \"%cd%\\%~nxi.csproj\" && cd $dir",
With this modification, we can directly run the .csproj file that has the same name as the source file. For C# files created by Visual Studio, this is the default behavior. I believe this method is relatively more convenient.
The text was updated successfully, but these errors were encountered:
Muyu-Chen
changed the title
[Bug] 对于C#的支持不够完整,我提供了一种解决方案
[Bug] Provide solution to improve C# support 对于C#的支持不够完整,我提供了一种解决方案
Jan 12, 2025
对于C#来说,我们需要通过dotnet run --project 才能运行一个项目(而不是脚本 script),然而如果我们转到csproj中运行,那这就不够优雅,因此我在配置中修改了文件,将路径修改了一下,修改为:
这样的话,我们就可以直接运行和文件名同名的csproj了,对于visual studio创建的c#文件来说,这是默认的,我认为这样是相较来说更方便的一种方法。
For C#, we need to use dotnet run --project to run a project (rather than a script). However, if we have to switch to the .csproj file directory to run it, it becomes less elegant. To address this, I modified the configuration by updating the path as follows:
With this modification, we can directly run the .csproj file that has the same name as the source file. For C# files created by Visual Studio, this is the default behavior. I believe this method is relatively more convenient.
The text was updated successfully, but these errors were encountered: