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:45

I was getting this error and it ended up being the app.config file, as well, that was write-protected. Changing the target framework not only changed

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

in the .csproj file but also changed the project's app.config:

<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

(I wanted to add this as a comment to pixelmeow's Jun 27 answer, but StackOverflow policy prevents me from doing so until I have enough reputation points. I did vote for him/her, though!)

查看更多
登录 后发表回答