I am using Visual Studio 2005. After taking code from version control first, the c#.net application runs correctly. But, after doing some modifications, when I build I am
You aren't supposed to change the folder attribute to not-readonly. The reason you are seeing this error message is that source control assumes that you only store your miscellaneous files somewhere other than bin folder, for it it reserved for files that are automatically created by .Net and it doesn't want to add them to source control.
I suggest instead of using Environment.CurrectDirectory
(which I assume you are using currently), you create a folder named "MyProjectName" in %appdata% address and then use:
System.IO.Path.Combine(Environment.GetEnvironmentVariable("appdata"),"YourProjectName")
.
Just make sure that the folder is NOT Read-Only and rebuild the solution
I also had this issue. Here's how is resolved this
bin
folder from project.This process is works for me.
Run your Visual Studio as Administrator
In my case it was the antivirus which blocked the file.
I had the same issue, To resolved this i had checked/done several things
What Didn't work
1) Read/write permissions were given to directory
2) Restarted visual studio
3) Tried deleting visual studio temp files
What worked at last
Just paste the command given by Fred Morrison into the "Package Manager Console":
Get-Process | Where-Object -Property Name -EQ 'VBCSCompiler' | Stop-Process -Force -Verbose
Note: Just an observation Restarting Visual studio might not work in this case but restarting system can because stoppin process "VBCSCompiler" was the solution so we can do it either way.