The error reads,
TargetFrameworkMoniker: An error occurred saving the project file 'yadayada.csproj'. Access is denied.
I'm trying to switch from .net 3.5 to .net 4.0 or higher.
The project is hooked into TFS in Visual Studio 2010 (also tried VS 2013, same error). I'm in a VM environment.
Any clues about this error? Google returns very little information. It seems like I have proper access to the file, but how is VS accessing it?
I got this error in my environment, which is straight VS 2013 Pro: no TFS and no VM. Unsetting the read-only box only changed the dialog display because reinvoking the dialog still showed read-only. I thought I changed the ownership of the project file to me by virtue of changing the ownership in a higher level directory and checking "Replace all child object permission entries with inheritable permission entries from this object." Of course the project file and everything else had inheritance turned off. Once that was corrected I was able to save things without being Administrator.
It sounds like either:
1)The file has been marked read only. Check this by viewing the properties of the csproj.
Or
2)Your user does not has sufficient permissions to change the file - check security on the csproj.
I was getting this error in visual studio 2010 because of my start action setting. Each time I would hit debug, I think the browser window was trying to launch too fast (this is an ASP.NET MVC 4 with intranet settings project).. and I would randomly, sometimes consistently get access denied. So I changed the start action to: "Don't open a page. Wait for a request from external application."
And this seemed to fix the issue. You will just have to access the web application manually rather than VS launching the browser for you. You can click on the running server icon (bottom right of taskbar) and access the link from there if you don't remember it or your browser didn't store it as a history url for whatever reason.
I was getting this error and it ended up being the app.config file that was write-protected. Once I cleared the read-only property, everything worked fine.
I have found that if you get the error, hit save, close visual studio and reopen the project you will find that 86.5% of the time the setting was changed.
Try running the Visual Studio in administrator mode and also check if your project folder is set to read only.