كيفية القيام بما يلي: الهروب خاص حرف/ حروف في ‏‫MSBuild

بعض حرف/ حروف لها معنى خاص في MSBuildملفات مشروع. تضمين أمثلة للأحرف الفاصلة المنقوطة (;) و العلامات النجمية (*). للحصول على قائمة كاملة بهذه حرف/ حروف المعينة، راجع أحرف خاص ‏‫MSBuild.

In order إلى استخدم these خاص characters كـ literals in a مشروع ملف, they must be specified by using the syntax %xx, where xx represents the ASCII hexadecimal value of the حرف.

أحرف خاص ‏‫MSBuild

أحد أمثلة حيث يتم استخدام أحرف خاص هو في Includeسمة لعنصر lهوts. ل مثال، عنصرين يقوم بتعريف قائمة عناصر التالية: MyFile.cs وMyClass.cs

<Compile Include="MyFile.cs;MyClass.cs"/>

If you want إلى declare an item that يحتوي على a semicolon in the name, you must استخدم the %xx syntax إلى escape the semicolon و prevent MSBuild from declaring two separate items. ل مثال، العنصر التالي يخرجك الفاصلة المنقوطة ويقوم بتعريف العنصر المسمى واحد MyFile.cs;MyClass.cs.

<Compile Include="MyFile.cs%3BMyClass.cs"/>

لاستخدام ‏‫MSBuild حرف خاص كحرف نصي

  • استخدم the notation %xx in place of the خاص حرف, where xx represents the hexadecimal value of the ASCII حرف. على سبيل المثال، إلى استخدام العلامة نجمية (*) كحرف نصي، استخدم القيمة %2A.

راجع أيضًا:

المبادئ

عناصر ‏‫MSBuild

موارد أخرى

MSBuild Concepts

MSBuild Overview