C
C#12mo 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
Kouhai12mo ago
You need semicolons ; on two lines Also why are you resolving the System namespace using global::, you don't need that
zykw
zykwOP12mo ago
semicolons doesnt help
No description
WAASUL
WAASUL12mo ago
Can you share your entire file?
zykw
zykwOP12mo ago
I'm trying to use simple command Console.WriteLine, but my PC adds global
WAASUL
WAASUL12mo ago
There might be some unnecessary imports, causing the issue.
zykw
zykwOP12mo ago
Wait
WAASUL
WAASUL12mo 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
Buddy12mo ago
$paste
MODiX
MODiX12mo 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
SG9712mo ago
judging from the lack of red squigglies (errors), something is wrong with the project
Buddy
Buddy12mo ago
I wonder .. Have you opened it as a folder? Or did you open the csproj / sln file?
The Fog from Human Resources
The project definitely doesn't get loaded properly
FestivalDelGelato
did you accidentally created a System.Console namespace?

Did you find this page helpful?