error TRK0002: Microsoft Visual Studio 10.0\VC\bin\link.exe Access is denied.

时间:2022-01-17 17:27:30

When you compile project, visual studio 2010 prompts “…link.exe … Access is denied”

This below is I met.


Error    5    error TRK0002: Failed to execute command: ""C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe" /ERRORREPORT:PROMPT @C:\Users\oliverliu\AppData\Local\Temp\25f8bec749d44c79a4e6e7f26163b5e6.rsp". Access is denied.    E:\CBTC_Simulator\SimSP\SimSpClient\TRACKER


The solution is

I added following code in the .vxproj file

<PropertyGroup> 
  <TrackFileAccess>false</TrackFileAccess> 
</PropertyGroup>

TrackFileAccess is introduced to improve the performance of resource compiler in the incremental build.

Quote from the link: 
http://bradwilson.typepad.com/blog/2010/05/working-around-build-error-msb3454.html

The resource compiler performance is dramatically improved by tracking files changes to your .resx files between builds; it's like incremental compilation from the C++ days, but for your resources. Getting this to work requires a tracker application to watch 
the file access, which is normally only part of the Windows SDK or Visual Studio.


Another Method:

Similar problem (not exactly same) is reported in this link:https://connect.microsoft.com/VisualStudio/feedback/details/527167/upgraded-2008-project-compile-error-filetracker-dll?wa=wsignin1.0

Solution proposed here : Modify %WinDir%\Microsoft.NET\Framework\v4.0.30128\Microsoft.Common.targets file by setting "TrackFileAccess" tag value as false. ( I am not sure that whether it would work or not)