C
C#7mo ago
jim

❔ 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
SG977mo ago
is that pathing related to your computer? c:\users\HungIntelSsd....
Trinitek
Trinitek7mo ago
also my thought; open your csproj in a text editor, what does it look like?
jim
jim7mo ago
yeag its my name iin there
jim
jim7mo ago
No description
No description
SG97
SG977mo ago
that's options
jim
jim7mo ago
what does he mean open in text editor?
SG97
SG977mo ago
literally open the csproj file in an editor, like notepad
jim
jim7mo ago
No description
WEIRD FLEX
WEIRD FLEX7mo ago
is it a net framework project or net core? iirc net framework had explicit .cs path in the csproj
jim
jim7mo ago
framework
WEIRD FLEX
WEIRD FLEX7mo 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)
jim
jim7mo ago
im gonna wait to see what the professor responds with tommorow
Pobiega
Pobiega7mo ago
Open the csproj, not the solution
jim
jim7mo ago
what do you mean by this?
Pobiega
Pobiega7mo ago
Exactly what I wrote You showed the wrong file
jim
jim7mo ago
I'm a beginner so I'm not sure what you meant by wrong file I opened what I usually opened
Pobiega
Pobiega7mo ago
You know how files have "file extensions", right? Like .exe .txt .dol etc
jim
jim7mo ago
Yes
Pobiega
Pobiega7mo ago
You showed the .sln file, we need to see the .csproj file
jim
jim7mo ago
Alright got it
jim
jim7mo ago
No description
Pobiega
Pobiega7mo ago
Still the wrong file
jim
jim7mo ago
whys that?
Pobiega
Pobiega7mo ago
This is your .cs file What file extension do we keep asking for?
jim
jim7mo ago
The project
Pobiega
Pobiega7mo ago
Which is ...
jim
jim7mo ago
No description
jim
jim7mo ago
i mean it says this is the project file
Pobiega
Pobiega7mo ago
Yes That's the one we want to see
jim
jim7mo ago
That was what I opened
Pobiega
Pobiega7mo ago
Open it in a text editor
jim
jim7mo ago
alright Ah I see
jim
jim7mo ago
No description
SG97
SG977mo ago
there we go
Pobiega
Pobiega7mo ago
Remove that itemgroup and it's content
jim
jim7mo ago
In both lines 10 and 12?
Pobiega
Pobiega7mo ago
10,11,12
SG97
SG977mo ago
(and save)
jim
jim7mo ago
saved So what exactly did that do for the program?
Pobiega
Pobiega7mo 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
jim
jim7mo ago
Would my professor still see the same error if I were to resubmit?
Pobiega
Pobiega7mo ago
Try to compile and run your program now If it works, you can do a clean and zip it up and send it
jim
jim7mo ago
My program worked from the very beginning it just didn't work for him
Pobiega
Pobiega7mo ago
I'm aware But you changed it just now
jim
jim7mo ago
yeah It works when I run it
Pobiega
Pobiega7mo ago
So let's verify that your changes didn't break it Okay, then do a clean then zip it
jim
jim7mo ago
alright @Pobiega oh so it now doesn't work anymore after the clean The change did break it
Pobiega
Pobiega7mo ago
What errors? Because your program.cs file doesn't refer to the other file at all
jim
jim7mo ago
No description
jim
jim7mo ago
This was a result of removing item group
Pobiega
Pobiega7mo ago
Nooe It's not. The real errors are in the log below Your "NguyenProgram4.cs" file contains another Main method
jim
jim7mo ago
what that mean?
Pobiega
Pobiega7mo ago
It means you are copypasting files blindly and it breaks shit
jim
jim7mo ago
oh So I gotta delete the copies?
Pobiega
Pobiega7mo ago
Any .cs file inside your project directory will be included in a compilation A single project must only have one main method
jim
jim7mo ago
How do I get rid of the extra main methods?
Pobiega
Pobiega7mo ago
How about you give it a try? I'm getting the distinct feeling you are not even trying to understand this yourself
jim
jim7mo ago
I'm giving it a try and I can't find a way to get rid of them
SG97
SG977mo ago
what's inside Program.cs hint: it says so in the error log
jim
jim7mo ago
I'm not finding what's wrong with it. The errors don't tell me exactly what it is
SG97
SG977mo ago
what is inside Program.cs wait
jim
jim7mo ago
I really am not sure
SG97
SG977mo ago
what's inside NguyenProgram4.cs
jim
jim7mo ago
The same as program.cs
SG97
SG977mo ago
why
jim
jim7mo ago
That's how it resulted
SG97
SG977mo ago
well, that's not going to work
jim
jim7mo ago
I know I got to possibly remove something but I have no clue how to or where to even start
Pobiega
Pobiega7mo ago
Why would your program need the same thing twice, in two files? where is the logic in that
jim
jim7mo ago
I see that wait....
jim
jim7mo ago
I figured out how to delete it Oh my god It works now
SG97
SG977mo ago
hopefully either of the files got deleted
jim
jim7mo ago
it did Now I have zero errors and zero warnings
SG97
SG977mo ago
there we go, errors are really important to read and duplicate code is always bad
jim
jim7mo ago
Thank you for the help guys
Pobiega
Pobiega7mo 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
jim
jim7mo ago
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
Trinitek7mo 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
jim
jim7mo ago
I wouldn't call this a waste of time bc I still learned what not to do 🙂
Accord
Accord7mo 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.
Want results from more Discord servers?
Add your server
More Posts
✅ Abstract classes as the WPF DesignContext?Does it matter if the value in `d:DesignContext="{d:DesignInstance Type=X}"` is an `abstract` class.✅ Null check not enough to safely convert from nullable enumI have a class declaring an `enum` and a nullable value for that `enum`: ```CS public readonly StdMo❔ How do I change the color of certain targets when they're shot, and also destroy others when shot?I have tagged the ones to be destroyed as destroy and the ones that change color as color, but neith❔ unity single jumpHi, I need some help about jump mechanics in unity, I have written a code that suppose to make the p❔ i don't have enough (any) experience with semaphores to know if my wpf app requires themi started a new role very recently and my first project is helping a client, an electrical engineer,❔ Wpf massive memory overheadHey guys, I have this wpf window which enables me to select a rectangle on the screen. It gets open✅ Stored Procedure HelpHello, I have a stored procedure in my project called `spGetVendor`. It takes one parameter, `@Vendo❔ Console.ReadLine != nullHi all, I'm went trough this Microsoft challenge (unsuccessfully) and after reviewing this solution✅ New to wpf and need some help with architecture.I have a game-listener that gets new information every second. I crreate an instance and start the ✅ Kinda new to MVC/C#/Razor - Need some help passing data from Model -> ControllerAs the title states, I'm kinda new to C#/MVC with a good bit of experience with software development