You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
-86Lines changed: 0 additions & 86 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,92 +266,6 @@ All PRs are required to have this at the top of the description:
266
266
267
267
Always put that at the top, without the block quotes. Without it, the users will NOT be able to try the PR and your work will have been in vain!
268
268
269
-
## Working with Templates
270
-
271
-
When modifying files in the `src/Templates/` directory, you must follow special template semantics and conventions to ensure the templates work correctly when users create new projects.
272
-
273
-
### Template Conditional Compilation Directives
274
-
275
-
Templates use special comment markers to control how preprocessor directives are processed during template instantiation:
276
-
277
-
#### Platform-Specific Directives (Build-Time)
278
-
279
-
Platform-specific `#if` directives (like `#if WINDOWS`, `#if ANDROID`, `#if IOS`, `#if MACCATALYST`) must be wrapped with `//-:cnd:noEmit` and `//+:cnd:noEmit` markers:
280
-
281
-
```csharp
282
-
//-:cnd:noEmit
283
-
#ifWINDOWS
284
-
// Windows-specific code
285
-
#endif
286
-
//+:cnd:noEmit
287
-
```
288
-
289
-
**Why?** These markers tell the template engine to preserve these directives in the generated code exactly as-is, so they will be evaluated at compile-time when the user builds their project.
# Copilot instructions for working with .NET MAUI Templates
2
+
# This file provides specific guidance when modifying template files in src/Templates/
3
+
4
+
# Apply these instructions only to files in the Templates directory
5
+
applicability:
6
+
paths:
7
+
- 'src/Templates/**'
8
+
9
+
instructions: |
10
+
# Working with .NET MAUI Templates
11
+
12
+
When modifying files in the `src/Templates/` directory, you must follow special template semantics and conventions to ensure the templates work correctly when users create new projects.
13
+
14
+
## Template Conditional Compilation Directives
15
+
16
+
Templates use special comment markers to control how preprocessor directives are processed during template instantiation:
17
+
18
+
### Platform-Specific Directives (Build-Time)
19
+
20
+
Platform-specific `#if` directives (like `#if WINDOWS`, `#if ANDROID`, `#if IOS`, `#if MACCATALYST`) must be wrapped with `//-:cnd:noEmit` and `//+:cnd:noEmit` markers:
21
+
22
+
```csharp
23
+
//-:cnd:noEmit
24
+
#if WINDOWS
25
+
// Windows-specific code
26
+
#endif
27
+
//+:cnd:noEmit
28
+
```
29
+
30
+
**Why?** These markers tell the template engine to preserve these directives in the generated code exactly as-is, so they will be evaluated at compile-time when the user builds their project.
0 commit comments