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
#pragma warning disable CS0618// Type or member is obsolete
221
+
#if _MAUIXAML_SOURCEGEN_BACKCOMPAT
222
222
CustomAttributexamlcAttr=null;
223
223
if(assemblyDefinition.HasCustomAttributes&&
224
224
(xamlcAttr=
@@ -236,9 +236,10 @@ public override bool Execute(out IList<Exception> thrownExceptions)
236
236
else
237
237
LoggingHelper.LogWarning($"{newstring(' ',2)}Assembly has both XamlCompilationAttribute and XamlProcessingAttribute. XamlCompilationAttribute will be ignored.");
238
238
}
239
-
#pragma warning restore CS0618// Type or member is obsolete
240
239
241
-
xamlcAttr=xamlProcessingAttr=null;
240
+
xamlcAttr=null;
241
+
#endif
242
+
xamlProcessingAttr=null;
242
243
243
244
foreach(varmoduleinassemblyDefinition.Modules)
244
245
{
@@ -255,10 +256,10 @@ public override bool Execute(out IList<Exception> thrownExceptions)
#pragma warning disable CS0618// Type or member is obsolete
262
+
#if _MAUIXAML_SOURCEGEN_BACKCOMPAT
262
263
if(module.HasCustomAttributes&&
263
264
(xamlcAttr=
264
265
module.CustomAttributes.FirstOrDefault(
@@ -276,9 +277,9 @@ public override bool Execute(out IList<Exception> thrownExceptions)
276
277
else
277
278
LoggingHelper.LogWarning($"{newstring(' ',2)}Module {module.Name} has both XamlCompilationAttribute and XamlProcessingAttribute. XamlCompilationAttribute will be ignored.");
278
279
}
279
-
#pragma warning restore CS0618// Type or member is obsolete
#pragma warning disable CS0618// Type or member is obsolete
323
+
#if _MAUIXAML_SOURCEGEN_BACKCOMPAT
323
324
if(typeDef.HasCustomAttributes&&
324
325
(xamlcAttr=
325
326
typeDef.CustomAttributes.FirstOrDefault(
@@ -338,9 +339,9 @@ public override bool Execute(out IList<Exception> thrownExceptions)
338
339
else
339
340
LoggingHelper.LogWarning($"{newstring(' ',6)}Type {typeDef.Name} has both XamlCompilationAttribute and XamlProcessingAttribute. XamlCompilationAttribute will be ignored.");
340
341
}
341
-
#pragma warning restore CS0618// Type or member is obsolete
<_MauiXamlInflatorCondition=" '$(MauiXamlInflator)' == '' And '$(Configuration)' == 'Debug' ">Runtime</_MauiXamlInflator>
12
+
<_MauiXamlInflatorCondition=" '$(MauiXamlInflator)' == '' And '$(Configuration)' != 'Debug' ">XamlC</_MauiXamlInflator>
13
+
9
14
<!-- The WINUI check for this only runs when there is an empty string so I just convert false to an empty string to fall in line with our other properties -->
<!-- Assign the default inflator to MauiXaml that don't have any -->
84
+
<!-- there's a roslyn bug that stops parsing value at the first semicolon. replace them all https://github.com/dotnet/roslyn/issues/43970 -->
sb.AppendLine("\t\t\t\t\tthrow new global::System.NotSupportedException($\"no code for {inflator} generated. check the [XamlProcessing] attribute.\");");
273
270
sb.AppendLine("\t\t\t}");
@@ -301,12 +298,14 @@ public static bool TryParseXaml(XamlProjectItemForCB parseResult, string uid, Co
301
298
returnfalse;
302
299
}
303
300
301
+
#if _MAUIXAML_SOURCEGEN_BACKCOMPAT
304
302
// if the following xml processing instruction is present
305
303
//
306
304
// <?xaml-comp compile="true" ?>
307
305
//
308
306
// we will generate a xaml.g.cs file with the default ctor calling InitializeComponent, and a XamlCompilation attribute
0 commit comments