'How do I make the hello world execute in C# terminal
am trying to find out why my C# 'hello world' program isn't running after installation and set up. this is my code below
using System;
namespace mysharpproject // Note: actual namespace depends on the project name.
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
this is the error the error am getting: + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
PS C:\Users\check> cd "c:\Users\check\Desktop\mysharpproject" $$ dotnet run tempCodeRunnerFile.cs Set-Location : A positional parameter cannot be found that accepts argument 'Program.cs'. At line:1 char:1
- cd "c:\Users\check\Desktop\mysharpproject" $$ dotnet run tempCodeRun ...
-
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
PS C:\Users\check>
Solution 1:[1]
THis command
cd "c:\Users\check\Desktop\mysharpproject" $$ dotnet run tempCodeRunnerFile.cs
includes '$$' that means the last part part of the previous command, why are you doing that?
What does $$, $?, $^ represent in powershell?
Just do
cd "c:\Users\check\Desktop\mysharpproject" ; dotnet run tempCodeRunnerFile.cs
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
