Unable to copy file - access to the path is denied

后端 未结 30 1265
死守一世寂寞
死守一世寂寞 2020-11-30 19:05

I am using Visual Studio 2005. After taking code from version control first, the c#.net application runs correctly. But, after doing some modifications, when I build I am

30条回答
  •  生来不讨喜
    2020-11-30 19:59

    You aren't supposed to change the folder attribute to not-readonly. The reason you are seeing this error message is that source control assumes that you only store your miscellaneous files somewhere other than bin folder, for it it reserved for files that are automatically created by .Net and it doesn't want to add them to source control.

    I suggest instead of using Environment.CurrectDirectory (which I assume you are using currently), you create a folder named "MyProjectName" in %appdata% address and then use:

    System.IO.Path.Combine(Environment.GetEnvironmentVariable("appdata"),"YourProjectName").

提交回复
热议问题