Could not write lines to file/Unable to delete file, Access to the path is denied.
2010-08-23 13:14
627 查看
When you get code from TFS or VSS, and you build the project, you may encounter the following error or warning message:
Error : Could not write lines to file "obj\Activities.csproj.FileList.txt". Access to the path '\obj\Activities.csproj.FileList.txt' is denied. Activities
Warning :Unable to delete file "\bin\Debug\MMOneTest.dll.config". Access to the path is denied.
Issue: As you can see, MSBuild is trying to write to the *.vbproj.FileList.txt file in the \obj folder, but access is denied. If you look at this file on disk, you will notice that it is marked as read-only. No big deal, just turn off the read-only flag. You do this and rebuild, but the build passes. Very good! You go home with a nice case of the "warm fuzzies" and sleep like a baby. In the morning you come in to the office to find that the nightly build broke with the same exception. You look at the *.vbproj.FileList.txt file and it is read-only on the build machine. You scratch your head and let out a expletives and then delete the entire \obj folder. Then the nightly build is run again and if fails again damn it! Oh look, the *.vbproj.FileList.txt file is back to read-only. Sounding familiar yet?
Problem: The build fails because the *.vbproj.FileList.txt file is read-only so MSBuild can't write to it.
Reason: The file is read-only because you checked the \obj folder into source control. When ever you do a Get source code control, the files are placed on the drive as read-only. The nightly build is configured to delete the prior run's source code (or should be) and Get from source control prior to building. Therefore every nightly build fails in the same way.
Solution: Delete the \obj or \bin folder from source control and check-in the change. That's it.
Error : Could not write lines to file "obj\Activities.csproj.FileList.txt". Access to the path '\obj\Activities.csproj.FileList.txt' is denied. Activities
Warning :Unable to delete file "\bin\Debug\MMOneTest.dll.config". Access to the path is denied.
Issue: As you can see, MSBuild is trying to write to the *.vbproj.FileList.txt file in the \obj folder, but access is denied. If you look at this file on disk, you will notice that it is marked as read-only. No big deal, just turn off the read-only flag. You do this and rebuild, but the build passes. Very good! You go home with a nice case of the "warm fuzzies" and sleep like a baby. In the morning you come in to the office to find that the nightly build broke with the same exception. You look at the *.vbproj.FileList.txt file and it is read-only on the build machine. You scratch your head and let out a expletives and then delete the entire \obj folder. Then the nightly build is run again and if fails again damn it! Oh look, the *.vbproj.FileList.txt file is back to read-only. Sounding familiar yet?
Problem: The build fails because the *.vbproj.FileList.txt file is read-only so MSBuild can't write to it.
Reason: The file is read-only because you checked the \obj folder into source control. When ever you do a Get source code control, the files are placed on the drive as read-only. The nightly build is configured to delete the prior run's source code (or should be) and Get from source control prior to building. Therefore every nightly build fails in the same way.
Solution: Delete the \obj or \bin folder from source control and check-in the change. That's it.
相关文章推荐
- Unable to copy file, Access to the path is denied
- [.net] 关于CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files… ‘Access is denied.’ 的解决办法
- Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\xxx' -- 'Access is denied. '
- fix errors 1088: “Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied” and 1334: “Exception: System.IO.FileLoadException”
- Could not write to output file 'c:\Windows\Microsoft.NET ASP.NET Files\root\xx' -- 'Access is denied
- 关于CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files… ‘Access is denied.’ 的解决办法
- 关于CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files… ‘Access is denied.’ 的解决办法
- CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\application1\c11b43f6\cf3ec03\rizcntet.dll' . The directory name is invalid.
- 关于CS0016: Could not write to output file ‘c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files… ‘Access is deni
- Solution to "Could not load file or assembly or one of its dependencies. Access is denied"
- IIS不能用,报错:Failed to execute request because the App-Domain could not be created. Error: 0×80070005 Access is denied
- [ASP.NET] FileUpload SaveAs() access to the path is denied
- 转:Access to the path "c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET Files/root/xxxxx/xxxxx" is denied.
- Access to the path 'E:/EIMS/EIMSweb/hshupfile/201006/20100621050801290.xls' is denied.
- SAP db13-ANS1087E (RC106) Access to the specified file or directory is denied
- 关于access to the path is denied问题的解决(路径被拒绝)
- Unable to read the project file 'client.csproj'. Could not load file or assembly 'Microsoft.Build.En
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- Could not load file or assembly 'XXX' or one of its dependencies. Access is denied.
- 异常处理 Access to the path is denied