@@ -182,7 +182,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
182182
183183 static void EmitConsoleAppTemplateSource ( IncrementalGeneratorPostInitializationContext context )
184184 {
185- context . AddSource ( "ConsoleApp.g.cs" , ConsoleAppBaseCode . InitializationCode ) ;
185+ context . AddSource ( "ConsoleApp.g.cs" , ConsoleAppBaseCode . InitializationCode . ReplaceLineEndings ( ) ) ;
186186 }
187187
188188 static void EmitConsoleAppRun ( SourceProductionContext sourceProductionContext , CommandContext commandContext )
@@ -209,7 +209,7 @@ static void EmitConsoleAppRun(SourceProductionContext sourceProductionContext, C
209209 var withId = new Emitter . CommandWithId ( null , command , - 1 ) ;
210210 emitter . EmitRun ( sb , withId , command . IsAsync ) ;
211211 }
212- sourceProductionContext . AddSource ( "ConsoleApp.Run.g.cs" , sb . ToString ( ) ) ;
212+ sourceProductionContext . AddSource ( "ConsoleApp.Run.g.cs" , sb . ToString ( ) . ReplaceLineEndings ( ) ) ;
213213
214214 var help = new SourceBuilder ( 0 ) ;
215215 help . AppendLine ( ConsoleAppBaseCode . GeneratedCodeHeader ) ;
@@ -218,7 +218,7 @@ static void EmitConsoleAppRun(SourceProductionContext sourceProductionContext, C
218218 var emitter = new Emitter ( ) ;
219219 emitter . EmitHelp ( help , command ) ;
220220 }
221- sourceProductionContext . AddSource ( "ConsoleApp.Run.Help.g.cs" , help . ToString ( ) ) ;
221+ sourceProductionContext . AddSource ( "ConsoleApp.Run.Help.g.cs" , help . ToString ( ) . ReplaceLineEndings ( ) ) ;
222222 }
223223
224224 static void EmitConsoleAppBuilder ( SourceProductionContext sourceProductionContext , CollectBuilderContext collectBuilderContext )
@@ -267,7 +267,7 @@ static void EmitConsoleAppBuilder(SourceProductionContext sourceProductionContex
267267 var emitter = new Emitter ( ) ;
268268 emitter . EmitBuilder ( sb , commandIds , hasRun , hasRunAsync ) ;
269269 }
270- sourceProductionContext . AddSource ( "ConsoleApp.Builder.g.cs" , sb . ToString ( ) ) ;
270+ sourceProductionContext . AddSource ( "ConsoleApp.Builder.g.cs" , sb . ToString ( ) . ReplaceLineEndings ( ) ) ;
271271
272272 // Build Help
273273
@@ -279,7 +279,7 @@ static void EmitConsoleAppBuilder(SourceProductionContext sourceProductionContex
279279 var emitter = new Emitter ( ) ;
280280 emitter . EmitHelp ( help , commandIds ! ) ;
281281 }
282- sourceProductionContext . AddSource ( "ConsoleApp.Builder.Help.g.cs" , help . ToString ( ) ) ;
282+ sourceProductionContext . AddSource ( "ConsoleApp.Builder.Help.g.cs" , help . ToString ( ) . ReplaceLineEndings ( ) ) ;
283283 }
284284
285285 static void EmitConsoleAppConfigure ( SourceProductionContext sourceProductionContext , DllReference dllReference )
@@ -311,7 +311,7 @@ static void EmitConsoleAppConfigure(SourceProductionContext sourceProductionCont
311311 sb2 . AppendLine ( "using Microsoft.Extensions.Hosting;" ) ;
312312 var emitter = new Emitter ( ) ;
313313 emitter . EmitAsConsoleAppBuilder ( sb2 , dllReference ) ;
314- sourceProductionContext . AddSource ( "ConsoleAppHostBuilderExtensions.g.cs" , sb2 . ToString ( ) ) ;
314+ sourceProductionContext . AddSource ( "ConsoleAppHostBuilderExtensions.g.cs" , sb2 . ToString ( ) . ReplaceLineEndings ( ) ) ;
315315 }
316316
317317 using ( sb . BeginBlock ( "internal static partial class ConsoleApp" ) )
@@ -321,7 +321,7 @@ static void EmitConsoleAppConfigure(SourceProductionContext sourceProductionCont
321321 emitter . EmitConfigure ( sb , dllReference ) ;
322322 }
323323
324- sourceProductionContext . AddSource ( "ConsoleApp.Builder.Configure.g.cs" , sb . ToString ( ) ) ;
324+ sourceProductionContext . AddSource ( "ConsoleApp.Builder.Configure.g.cs" , sb . ToString ( ) . ReplaceLineEndings ( ) ) ;
325325 }
326326
327327 class CommandContext ( Command ? command , bool isAsync , DiagnosticReporter diagnosticReporter , InvocationExpressionSyntax node ) : IEquatable < CommandContext >
0 commit comments