error after modifying csproj
i added a line at the bottom of my csproj file and it gave an error then i deleted the line and saved but it didn't fix the problem i asked gpt about it and he couldn't fix either. i dont wanna do all the work again since i just made a login screen. Anything that can cure me?
112 Replies
details can cure you
we have no idea what you did so we can't tell you how to fix it
okay long story short i added this line at the bottom of my csproj file
wait not this one
<GenerateProgramFile>false</GenerateProgramFile>
this
then my program gave out errors and i closed the app and i deleted that line
Can you clean the solution and rebuild
tried but it gave some errors
What are the errors
lemme find
well, "at the bottom" wouldn't be a valid place to put that in the first place
what kind of project is this?
i was doing a mail app
similiar to gmail
i mean why do you need that project setting
oh btw after the incident i tried to transfer my files to another project
Yeh but what type of project is it? Frame work wise
to make roundbuttons 😊
windows forms app .net
also after the incident
do you use version control?
whats that
like git
uhh i guess not?
it keeps track of your changes so if you break something you can revert it more easily
i never clicked on something like that to enable or add to my code
it's a separate tool/program, but it could be integrated into your editor
A vcs prevents these situations cuz u can roll back any changes within the repo
every single programmer should use version control, there is no exception
i searched git on windows search but no results
i guess i dont have it
If your using visual studio there’s a button in the toolbar to create/init a git repo
anyway back to your actual issue, what is your reasoning for adding that project setting to your project
because i've never even seen it, and looking it up doesn't make it seem applicable to a winforms app
making buttons that has its corners round
chatgpt said so 🤓
You’ll have to install it, if you enable it within vcs it should attempt to install it on ur system if it’s missing
brother
don't use chatgpt for things you don't already understand
okay i'Ll install it
because this has nothing to do with styling/themes
To add to this, try not to just blindly insert code without understanding
im still a beginner and trying to make something, i have a pdf file to teach stuff but it doesnt have anything
i asked him on a mockup for the login page
and then he started talking about roundbuttons and sutff
Who?
gpt?
chatgpt isn't a person
:kekw:
it can't even think
it's basically just a really fancy text predictor, it has no self awareness
it has no idea if what it's telling you is correct or relevent, just that statistically it's something it should say in response to your question
Yeh but back to ur issue, I recommend potentially setting up a new project moving ur code to the new one. Minus the changes u made to csproj.
I don’t think we will get to the bottom of the real issue
i tried to move my project tho
lemme explain 😄
i selected all the files in that project folder
i recommend using proper tutorials and reference material to learn the tools and frameworks you want to use
and dragged it to another project then swapped them with the mail app
guess what
didn't work
Can you send us the error message/s
depending on the SDK version i wouldn't expect it to work
don't just do random things, you probably made it worse
i gotta try moving the files back to the original project
all you had to do was undo the change you made in your csproj, you probably deleted something you shouldn't have
i just choosed that line i sended earlier
and saved
well, you didn't
oh wait
its not for roundbuttons mb
because if that's what you did, it wouldn't be broken
i had an error saying the project was open somewhere and didnt let me f5 it
we don't even know what broken means because we went off on a tangent
so do you thinks its unsaveable now?
i haven't seen a single actual line of code or project file so i can't answer that
okay what do you need to see
it seems like you're going way too fast without thinking about what you're doing
i'Ll try to find it
i guess so
I also don’t recommend blindly adding code without checking what it does in official docs
And checking to see how it will affect the application
Have you even said what the error message is?
I’ve asked twice
🤣🤣
i have more than one tho what do i even need to send
wait first let me make everything clear
All of them
all i can see in reference to that msbuild option is using it to resolve issues with xunit projects
chatgpt telling you to use it for a basic winforms application is almost definitely wrong
first i added a line in the bottom of my csproj file, then i removed it back after a popup error message i didn't save or ss'd then i searched up for ways and i tried to do dotnet clean rebuild and build
let me find the error message about the dotnet clean
dotnetclean worked perfectly fine after i closed vs2022 and it successed without errors
and i did dotnet build
uh how do i send stuff with code part
$paste
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
its not long i just dont know how to make it look like code
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/Backticks not single quotes
is it possible to set your OS language to english
i can't read that :PepeLaugh:
😄 i copied this from the gpt log
??
🤣🤣🤣🤣
i sent that to gpt too 😄
Determining projects to restore...
No action to take. None of the specified projects contain packages to restore.
we don't care what gpt shits out whatsoever, we care about the actual tools and code
any mention of chatgpt is going to make people not want to help
calm down buddy i just said i copied the error from there because i sent it there first
i copied what i sent to it
damn
How does gpt know what the error message is
NO
when i copied the erorr
i sent it there
i mean you're typing a mile a minute and haven't actually told us anything useful about the problem yet
Why not send it here?
So we can see it
im trying to say that before i came to ask help here i sent the error to gpt
U don’t need to run it through gpt before sending it here mate
i wasn't in this server when i did those
just cease using chatgpt entirely, it's a huge trap for beginners
Ah okay, use backticks and send it here
will do
it works until it doesn't and then you have no idea what you've done and therefore can't explain what you did to the real humans who can actually help
:LUL:
Ur using gpt in the worst possible way
And at the worst stage
chatgpt should be treated like a little idiot man living in your computer
""cs
C:\Users\H z E f e l i n s s\Desktop\Bombo Projects\PaliMail>dotnet build
Determining projects to restore...
No action to take. None of the specified projects contain packages to restore.
C:\Program Files\dotnet\sdk\8.0.401\Microsoft.Common.CurrentVersion.targets(3413,5): error MSB3823: GenerateResourceUsePreserializedResources property must be set to true for non-string resources. [C:\Users\H z E f e l i n s s\Desktop\Bombo Projects\PaliMail\PaliMail\PaliMail.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Microsoft.Common.CurrentVersion.targets(3413,5): error MSB3822: The System.Resources.Extensions assembly is required at runtime for non-string resources, but it was not found in the references for this project. [C:\Users\H z E f e l i n s s\Desktop\Bombo Projects\PaliMail\PaliMail\PaliMail.csproj]
CREATION FAILED.
C:\Program Files\dotnet\sdk\8.0.401\Microsoft.Common.CurrentVersion.targets(3413,5): error MSB3823: The GenerateResourceUsePreserializedResources property must be set to true for non-string resources. [C:\Users\H z E f e l
i n s s\Desktop\Bombo Projects\PaliMail\PaliMail\PaliMail.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Microsoft.Common.CurrentVersion.targets(3413,5): error MSB3822: The System.Resources.Extensions assembly is required at runtime for non-string resources, but it was not found in this project's references. [C:\Users\H z E f e l i n s s\Desktop\Bombo Projects\PaliMail\PaliMail\PaliMail.csproj]
0 Warnings
2 Errors
Elapsed Time 00:00:00.60
""
you can try and get it to do stuff but you should never blindly trust what it tells you
it didn't work again am i doing it wrong?
Bsckticks mate
"
` not '
isn't this a backtick
that's a quote
oh mb ``
this?
yes
im not native english im sorry
i mean i don't know much about winforms but that generally looks like you changed something in your csproj that you shouldn't have, or you did something to the resources
uhh i just remembered
after all that shit i trusted gpt again and added some stuff into the csproj
but i added them in the correct spots this time
you're making it incredibly difficult for us to help you
and after that one of the 2 errors disappeared
i'll just scrap the other sln can you help me on moving my code?
i never did it before
i cannot
at this point i'm going to assume you copied in a bunch of ai slop and completely ruined your project
and i don't have time to fix chatgpt's mistakes
main takeaways from this should be: use version control so you can roll back your changes, and do not use chatgpt for things you don't understand
do i just need to google versioncontrol and download the app?
you should google git and look at guides on how to use it
okay
$git
interactive teaching:
https://learngitbranching.js.org/
msft learn course:
https://learn.microsoft.com/en-us/training/modules/intro-to-git/
git init
initializes the repository
dotnet new gitignore
adds a .gitignore file
git add .
starts tracking all files
git commit -m "[message]"
creates a commit
git remote add origin [url]
adds a remote repository
git push -u origin main
first push, sets the remote as upstream
git push
all pushes after that can be just this
Git cheat sheetis this the git i am supposed to download?

yes
If you have your existing source code (.cs) files, you can probably just start over from scratch with a new empty project (
dotnet new winforms --name MyProject
or whatever) and then just copy the .cs files over under the new folder.