#How to fix this
1 messages · Page 1 of 1 (latest)
C:\Program Files\dotnet\sdk\7.0.305\Microsoft.Common.CurrentVersion.targets(4685,5): error MSB3021: Unable to copy file "obj\De
bug\net7.0\if.dll" to "bin\Debug\net7.0\if.dll". The process cannot access the file 'C:\Users\user\OneDrive\Desktop\if\bin\Debu
g\net7.0\if.dll' because it is being used by another process. [C:\Users\user\OneDrive\Desktop\if\if.csproj]
The error message is pretty clear.
The solution should be simple as well: Don't store your projects on OneDrive. If you need versioning, use Git.
oh i might got it
so should i save my project in once folder?
Pretty much.
If you need a remote host for your version control repositories, you can use GitHub (Git host by Microsoft).
Wdym "in once folder"?
Is that your Desktop?
I would advise against putting projects on your Desktop; that'll just create a mess.
Instead, make a folder somewhere on your hard drive (I think the default location would be C:\source\). Personally, I have a dedicated hard drive for programming projects.
64
wym make a folder somewhere on my hard drive because when i open folder i need to choose a folder that i program
oh i got it
alr
so i should download git for fix problem that all right?
which should i choose
or up to me
You don't need git to fix your problem.
I just suggested it because you originally put your project into your OneDrive - which I assumed you did because you wanted file versioning.
If you read my original message again, I said that the fix is to not save your projects in your OneDrive.
If you still want to install git, the default settings should be fine.
that should solve the issue, yes
(as long as you don't choose another restricted location to put your project in)
dunno
try running dotnet clean
He say that the file is locked by .Net host
YES
It run
finally
omg thank you so much
but still have the problem ;-;
The path in the screenshot you sent still says "OneDrive".
Aside from that, try deleting the bin and obj folders from your project directory.
And maybe consider using Visual Studio, rather than Visual Studio Code.
Windows by default uses it
Your desktop, documents, pictures, music, and videos folders are all onedrive synched. You have to explicitly turn it off it's stupid