C
C#5mo ago
zykw

global::System.Console.WriteLine(); error

Hi everyone I have problem with command Console.WriteLine, before I used this through cw + TAB, but now it doesn't work like before. What I should do to improve this?
No description
13 Replies
Kouhai /人◕ ‿‿ ◕人\
You need semicolons ; on two lines Also why are you resolving the System namespace using global::, you don't need that
zykw
zykw5mo ago
semicolons doesnt help
No description
SwaggerLife
SwaggerLife5mo ago
Can you share your entire file?
zykw
zykw5mo ago
I'm trying to use simple command Console.WriteLine, but my PC adds global
SwaggerLife
SwaggerLife5mo ago
There might be some unnecessary imports, causing the issue.
zykw
zykw5mo ago
Wait
SwaggerLife
SwaggerLife5mo ago
Or do you happen to have a file named GlobalUsings.cs? You can disable global usings. I think that's what's causing the issue. In csproj file, add this line under <ImplicitUsings>disable</ImplicitUsings> <PropertyGroup>. Also remove global::System.Console.WriteLine();. But I would recommend fixing it instead of disabling it.
Buddy
Buddy5mo ago
$paste
MODiX
MODiX5mo ago
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
SG97
SG975mo ago
judging from the lack of red squigglies (errors), something is wrong with the project
Buddy
Buddy5mo ago
I wonder .. Have you opened it as a folder? Or did you open the csproj / sln file?
Waffles from Human Resources
The project definitely doesn't get loaded properly
WEIRD FLEX
WEIRD FLEX5mo ago
did you accidentally created a System.Console namespace?