jueves, 12 de febrero de 2026

me tira error me tiro de los pelos

Compila pero no hace lo que debe. En mi época universitaria el código de los libros de programación se publicaba sin una edición cuidadosa y nunca corrían:

❯ dotnet run -- link add --name 'ScanLibs' --url 'https://www.scanlibs.com'
Unhandled exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at bookmarkr.BookmarkService.AddLinks(String[] names, String[] urls, String[] categories) in C:\csharpProjects\Building-CLI-Applications-with-C-Sharp-and-dotNET\bookmarkr\BookmarkService.cs:line 45
   at bookmarkr.Program.<Main>g__OnHandleAddLinkCommand|1_2(String[] names, String[] urls, String[] categories) in C:\csharpProjects\Building-CLI-Applications-with-C-Sharp-and-dotNET\bookmarkr\Program.cs:line 188
   at System.CommandLine.Handler.<>c__DisplayClass3_0`3.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.<>c__DisplayClass2_0.<.ctor>g__Handle|0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()

Uno puede despelucarse tratando de hallar un bug.  

 

No hay comentarios:

Publicar un comentario