C
C#3w ago
jadders

✅ VS Code with C# dev kit always shows an error when I reference another class in the same namespac

I always get these errors, even though the class I'm referencing exists in the scope. Is this just a VS Code visual issue?
No description
32 Replies
jadders
jaddersOP3w ago
Does the "create new file" option in VS Code not work the same as "Add > Class" in Visual Studio?
ero
ero3w ago
please show BlogpostTag.cs
jadders
jaddersOP3w ago
No description
ero
ero3w ago
please show your project
jadders
jaddersOP3w ago
No description
ero
ero3w ago
you have the devkit installed, enabled, and the solution is open?
jadders
jaddersOP3w ago
No description
jadders
jaddersOP3w ago
No description
jadders
jaddersOP3w ago
Yeah I think everything is in order
ero
ero3w ago
this doesn't show the solution being opened F1 -> .NET: Open Solution
jadders
jaddersOP3w ago
No description
jadders
jaddersOP3w ago
pressing the above, and nothing happens, the option is there though
ero
ero3w ago
okay, you have it open at the bottom on the left. open the Models folder there
jadders
jaddersOP3w ago
No description
jadders
jaddersOP3w ago
it isn't there? does it need to be committed to git hub before it shows?
ero
ero3w ago
no, that shouldn't be necessary
jadders
jaddersOP3w ago
So I should only be creating files and all through the solution explorer?
ero
ero3w ago
also no i'm a bit confused as to why it wouldn't pick up on that file
jadders
jaddersOP3w ago
yeah, same here
ero
ero3w ago
can you maybe just delete bin and obj and then reload the window
jadders
jaddersOP3w ago
sure, let me try
ero
ero3w ago
vscode is my main ide for c# and i never use the solution explorer and creating files through the file explorer works fine
jadders
jaddersOP3w ago
that did work! But obj and bin are now empty
ero
ero3w ago
that's fine, they'll be regenerated obj shouldn't be empty
jadders
jaddersOP3w ago
oh wairt it isn't now
ero
ero3w ago
mhm
jadders
jaddersOP3w ago
bin isa though. when i buildit will regen?
ero
ero3w ago
yup
jadders
jaddersOP3w ago
ahh sound, thanks for the help man!
ero
ero3w ago
$close
MODiX
MODiX3w ago
If you have no further questions, please use /close to mark the forum thread as answered
jadders
jaddersOP3w ago
You're awesome

Did you find this page helpful?