문제

What does

attrib -r "$(ProjectDir)FileName.cs"

means?.
Can any one explain me the meaning of this and also where can I find the list of Prebuild events?

도움이 되었습니까?

해결책

Prebuild events are commands that you can set for every project in your solution.
They will be executed before the build of your project starts.

In your case the DOS command ATTRIB will be executed against the file FILENAME.CS located in the current project folder. The ATTRIB command will be executed using the -r flag that will REMOVE the READONLY attribute for the file.

The syntax $(ProjectDir) is just a Visual Studio substitution string. It is used to identify a particular folder in your project or solution. Here you can find a full list of available substitution strings along with a more elaborated explanation of Pre/Post build events

다른 팁

Build events are simply commands that are run via cmd.exe similar to a .bat file. attrib is a simple windows command. It sets attributes on a file (read-only, system, hidden).

attrib -r "$(ProjectDir)FileName.cs" will remove the read-only attribute from the file if it is set.

You can find a list of VS macros like $(ProjectDir) here: http://msdn.microsoft.com/en-us/library/c02as0cs.aspx

It means that before building your projet, the file FileName.cs, stored at the root of your project directory, will be set as a readonlyfile.

You can see the pre-build event in the properties of your project (right click on your project in Visual Studio, and then select Properties), in the Build Events section.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top