❔ Professor issue.

I'm unsure why my professor is seeing this pop up when he runs my code. I downloaded the zip file I sent to my professor and the zip code works fine. Anyone know why he gets this error while i don't?
No description
81 Replies
SG97
SG9717mo ago
is that pathing related to your computer? c:\users\HungIntelSsd....
Trinitek
Trinitek17mo ago
also my thought; open your csproj in a text editor, what does it look like?
Weltman's left nostril booger
yeag its my name iin there
SG97
SG9717mo ago
that's options
Weltman's left nostril booger
what does he mean open in text editor?
SG97
SG9717mo ago
literally open the csproj file in an editor, like notepad
this_is_pain
this_is_pain17mo ago
is it a net framework project or net core? iirc net framework had explicit .cs path in the csproj
Weltman's left nostril booger
framework
this_is_pain
this_is_pain17mo ago
(also, doesn't the professor know how to deal with this?) (i mean, he could just remove and re-add the files to the project)
Weltman's left nostril booger
im gonna wait to see what the professor responds with tommorow
Pobiega
Pobiega17mo ago
Open the csproj, not the solution
Weltman's left nostril booger
what do you mean by this?
Pobiega
Pobiega17mo ago
Exactly what I wrote You showed the wrong file
Weltman's left nostril booger
I'm a beginner so I'm not sure what you meant by wrong file I opened what I usually opened
Pobiega
Pobiega17mo ago
You know how files have "file extensions", right? Like .exe .txt .dol etc
Pobiega
Pobiega17mo ago
You showed the .sln file, we need to see the .csproj file
Weltman's left nostril booger
Alright got it
Pobiega
Pobiega17mo ago
Still the wrong file
Weltman's left nostril booger
whys that?
Pobiega
Pobiega17mo ago
This is your .cs file What file extension do we keep asking for?
Weltman's left nostril booger
The project
Pobiega
Pobiega17mo ago
Which is ...
Weltman's left nostril booger
i mean it says this is the project file
Pobiega
Pobiega17mo ago
Yes That's the one we want to see
Weltman's left nostril booger
That was what I opened
Pobiega
Pobiega17mo ago
Open it in a text editor
Weltman's left nostril booger
alright Ah I see
SG97
SG9717mo ago
there we go
Pobiega
Pobiega17mo ago
Remove that itemgroup and it's content
Weltman's left nostril booger
In both lines 10 and 12?
Pobiega
Pobiega17mo ago
10,11,12
SG97
SG9717mo ago
(and save)
Weltman's left nostril booger
saved So what exactly did that do for the program?
Pobiega
Pobiega17mo ago
You were linking in another cs file from outside the project directory Based on your program.cs file, the code in that file wasn't being used anyways
Weltman's left nostril booger
Would my professor still see the same error if I were to resubmit?
Pobiega
Pobiega17mo ago
Try to compile and run your program now If it works, you can do a clean and zip it up and send it
Weltman's left nostril booger
My program worked from the very beginning it just didn't work for him
Pobiega
Pobiega17mo ago
I'm aware But you changed it just now
Weltman's left nostril booger
yeah It works when I run it
Pobiega
Pobiega17mo ago
So let's verify that your changes didn't break it Okay, then do a clean then zip it
Weltman's left nostril booger
alright @Pobiega oh so it now doesn't work anymore after the clean The change did break it
Pobiega
Pobiega17mo ago
What errors? Because your program.cs file doesn't refer to the other file at all
Weltman's left nostril booger
This was a result of removing item group
Pobiega
Pobiega17mo ago
Nooe It's not. The real errors are in the log below Your "NguyenProgram4.cs" file contains another Main method
Weltman's left nostril booger
what that mean?
Pobiega
Pobiega17mo ago
It means you are copypasting files blindly and it breaks shit
Weltman's left nostril booger
oh So I gotta delete the copies?
Pobiega
Pobiega17mo ago
Any .cs file inside your project directory will be included in a compilation A single project must only have one main method
Weltman's left nostril booger
How do I get rid of the extra main methods?
Pobiega
Pobiega17mo ago
How about you give it a try? I'm getting the distinct feeling you are not even trying to understand this yourself
Weltman's left nostril booger
I'm giving it a try and I can't find a way to get rid of them
SG97
SG9717mo ago
what's inside Program.cs hint: it says so in the error log
Weltman's left nostril booger
I'm not finding what's wrong with it. The errors don't tell me exactly what it is
SG97
SG9717mo ago
what is inside Program.cs wait
Weltman's left nostril booger
I really am not sure
SG97
SG9717mo ago
what's inside NguyenProgram4.cs
Weltman's left nostril booger
The same as program.cs
SG97
SG9717mo ago
why
Weltman's left nostril booger
That's how it resulted
SG97
SG9717mo ago
well, that's not going to work
Weltman's left nostril booger
I know I got to possibly remove something but I have no clue how to or where to even start
Pobiega
Pobiega17mo ago
Why would your program need the same thing twice, in two files? where is the logic in that
Weltman's left nostril booger
I see that wait....
Weltman's left nostril booger
I figured out how to delete it Oh my god It works now
SG97
SG9717mo ago
hopefully either of the files got deleted
Weltman's left nostril booger
it did Now I have zero errors and zero warnings
SG97
SG9717mo ago
there we go, errors are really important to read and duplicate code is always bad
Weltman's left nostril booger
Thank you for the help guys
Pobiega
Pobiega17mo ago
you're welcome. do try and learn the lesson here that errors are to HELP you, not to be "omg something is wrong" about
Weltman's left nostril booger
Professor rechecked my code and he pasted the code into a new console log and it worked for him. We didn't have to do any of this 😂
Trinitek
Trinitek17mo ago
I'm hoping you remember to not do whatever you did to fuck up your csproj file, so this wasn't a complete waste of time
Weltman's left nostril booger
I wouldn't call this a waste of time bc I still learned what not to do 🙂
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?