Receiving access denied error from Visual Studio w

2019-06-15 18:57发布

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?

7条回答
不美不萌又怎样
2楼-- · 2019-06-15 19:18

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.

查看更多
叼着烟拽天下
3楼-- · 2019-06-15 19:23

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.

查看更多
Anthone
4楼-- · 2019-06-15 19:25

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.

查看更多
ら.Afraid
5楼-- · 2019-06-15 19:33

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.

查看更多
Juvenile、少年°
6楼-- · 2019-06-15 19:35

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.

查看更多
Viruses.
7楼-- · 2019-06-15 19:45

Try running the Visual Studio in administrator mode and also check if your project folder is set to read only.

查看更多
登录 后发表回答