-
Notifications
You must be signed in to change notification settings - Fork 241
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
TodosApi updates #1836
TodosApi updates #1836
Conversation
src/BenchmarksApps/BasicMinimalApi/Properties/launchSettings.json
Outdated
Show resolved
Hide resolved
src/BenchmarksApps/BasicMinimalApi/Properties/launchSettings.json
Outdated
Show resolved
Hide resolved
@@ -9,12 +9,27 @@ | |||
<LangVersion>preview</LangVersion> | |||
<UserSecretsId>b8ffb8d3-b768-460b-ac1f-ef267c954c85</UserSecretsId> | |||
<PublishAot>true</PublishAot> | |||
<EnableLogging Condition="$(Configuration.StartsWith('Debug'))">true</EnableLogging> | |||
<EnableConfigurationBindingGenerator>false</EnableConfigurationBindingGenerator> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we disabling this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Cos it's currently broken (it literally generates code with a compilation bug)
282d82f
to
5eb620c
Compare
@@ -8,7 +8,7 @@ | |||
"/throw": { | |||
"get": { | |||
"tags": [ | |||
"TodosApi" | |||
"TodosApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems not ideal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting. I'm assuming you mean the tag seemingly being the full assembly name? This was produced by our own package (MS.Ext.ApiDescription.Server) but not sure why it changed. It's possible the previous version was produced by the Swashbuckle CLI and there's a subtle difference somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, is this from an old commit? The latest doesn't have this, perhaps it was the Swashbuckle CLI that added it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c8b51ca
to
2f85f8b
Compare
|
||
internal static class HostEnvironmentExtensions | ||
{ | ||
public static bool IsBuild(this IHostEnvironment hostEnvironment) => hostEnvironment.IsEnvironment("Build"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this "Build"
environment get defined/set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to set it manually via the ASPNETCORE_ENVIRONMENT
env var. So e.g. in PowerShell to generate the swagger file you'd do this:
> $env:ASPNETCORE_ENVIRONMENT='Build' ; dotnet build -p:OpenApiGenerateDocumentsOnBuild=true ; $env:ASPNETCORE_ENVIRONMENT=$null
One could of course create a bash/PS/batch script to make this a simple invocation.
<ItemGroup> | ||
<Content Update="appSettings.Development.json" CopyToPublishDirectory="false" /> | ||
<!-- Workaround for https://github.com/dotnet/aspnetcore/issues/47941 --> | ||
<IlcArg Include="--nopreinitstatics" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete this now that dotnet/runtime#85506 is fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has that fixed flowed to installers yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so, but we don't need it to. The benchmarks use the latest daily build of runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has not (talking about main
here). While this would run on the perf infrastructure 'cos it pulls the latest individual runtime installers, it would be very difficult to run this on dev machines until the fix flows to the main
SDK installer, so I think we shouldn't be removing workarounds until that happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's coming in dotnet/installer#16275. Hasn't been merged yet.
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
…om/aspnet/Benchmarks into damianedwards/stage2-configbinding
Microsoft.AspNetCore.OpenApi
)$env:ASPNETCORE_ENVIRONMENT='Build' ; dotnet build -p:OpenApiGenerateDocumentsOnBuild=true ; $env:ASPNETCORE_ENVIRONMENT=$null
Seems to have no performance impact: