放假前还好好的,今天打开工程,一编译,出这个错误了,请教大家,怎么办啊?错误如下:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3022,9): error MSB3491: Could not write lines to file "obj\CPTV.csproj.FileList.txt". Access to the path 'D:\PRO\CPTV\obj\CPTV.csproj.FileList.txt' is denied.谢谢各位!

解决方案 »

  1.   

    D:\PRO\CPTV\obj\CPTV.csproj.FileList.txt這個文件還在嗎?
      

  2.   

    看一下你得iis中的asp.net的版本号,有时会莫名其妙地变为1.0的版本
      

  3.   

    using System;
        using System.IO;
        using System.Text;    class Test
        {
            public static void Main()
            {
                string path = @"c:\temp\MyTest.txt";            // Create the file if it exists.
                if (!File.Exists(path))
                {
                    File.Create(path);
                }            if ((File.GetAttributes(path) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                {
                    // Show the file.
                    File.SetAttributes(path, FileAttributes.Normal);
                    Console.WriteLine("The {0} file is no longer read only.", path);
                }
                else
                {
                    // Hide the file.
                    File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.ReadOnly);
                    Console.WriteLine("The {0} file is now read only.", path);
                }
            }
        }