Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host.json: Ignore comments and trailing commas #2851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fowl2
Copy link

@fowl2 fowl2 commented Nov 12, 2024

Because commenting your configuration is a good idea.

Fixes error stacks similar this:

System.Text.Json.JsonException:
   at System.Text.Json.ThrowHelper.ReThrowWithPath (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.JsonSerializer.ReadFromSpan (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.JsonSerializer.ReadFromSpan (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.JsonSerializer.Deserialize (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.AspNetMiddleware.FunctionsEndpointDataSource.GetRoutePrefix (Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore, Version=1.3.2.0, Culture=neutral, PublicKeyToken=551316b6919f366c: /mnt/vss/_work/1/s/extensions/Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/FunctionsEndpointDataSource.cs:135)
   at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.AspNetMiddleware.FunctionsEndpointDataSource.GetRoutePrefixFromHostJson (Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore, Version=1.3.2.0, Culture=neutral, PublicKeyToken=551316b6919f366c: /mnt/vss/_work/1/s/extensions/Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/FunctionsEndpointDataSource.cs:129)
   at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.AspNetMiddleware.FunctionsEndpointDataSource.BuildEndpoints (Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore, Version=1.3.2.0, Culture=neutral, PublicKeyToken=551316b6919f366c: /mnt/vss/_work/1/s/extensions/Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/FunctionsEndpointDataSource.cs:61)
   at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.AspNetMiddleware.FunctionsEndpointDataSource.get_Endpoints (Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore, Version=1.3.2.0, Culture=neutral, PublicKeyToken=551316b6919f366c: /mnt/vss/_work/1/s/extensions/Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/FunctionsEndpointDataSource.cs:44)
   at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.CreateEndpointsUnsynchronized (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.EnsureEndpointsInitialized (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.get_Endpoints (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Routing.DataSourceDependentCache`1.Initialize (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Threading.LazyInitializer.EnsureInitializedCore (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher..ctor (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Routing.Matching.DfaMatcherFactory.CreateMatcher (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.InitializeCoreAsync (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware+<<Invoke>g__AwaitMatcher|10_0>d.MoveNext (Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol+<ProcessRequests>d__238`1.MoveNext (Microsoft.AspNetCore.Server.Kestrel.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception System.Text.Json.JsonReaderException handled at System.Text.Json.ThrowHelper.ReThrowWithPath:
   at System.Text.Json.ThrowHelper.ThrowJsonReaderException (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Utf8JsonReader.ConsumeNextToken (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Utf8JsonReader.ReadSingleSegment (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Utf8JsonReader.Read (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore (System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)

There are probably other places change, but this is the mentioned above.

see #2855

@satvu
Copy link
Member

satvu commented Nov 12, 2024

@fowl2 thank you for contributing - could you also add a test case in this file?

@fabiocav
Copy link
Member

/azp run

Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@fabiocav
Copy link
Member

/azp run dotnet-worker.public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@fabiocav
Copy link
Member

@fowl2 the changes look good. Would you be able to address @satvu's comment here?

@fowl2
Copy link
Author

fowl2 commented Nov 14, 2024

@fabiocav sure, however that file doesn't exist, should I create it? Is there one to base it on?

@jviau
Copy link
Contributor

jviau commented Nov 14, 2024

It was moved to here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants