Skip to content

Acceptance Criteria

Andrew Stanton-Nurse edited this page May 29, 2019 · 9 revisions

In order to complete a milestone, all bugs must be labelled with the accepted label. Prior to applying this label, complete the following checklist (shown in Markdown format below so you can copy-paste it into the issue if you'd like):

**Acceptance checklist** (check one item)
* [ ] We decided not to take this fix.
* [ ] The fix is tests-only.
* [ ] The fix contains product changes (**check all items below**).
    * [ ] Relevant XML documentation comments for new public APIs are present.
    * [ ] Narrative docs (docs.microsoft.com) are updated. (**check one item below**)
        * [ ] The change requires a new article. An issue with an outline has been filed here: [ISSUE LINK]
        * [ ] The change requires a change to an existing article. A docs PR with these changes is linked here: [PR LINK]
        * [ ] The change requires no docs changes.
    * [ ] Verification has been completed. (**check one item below**)
        * [ ] The change is in the shared framework and was verified against the following versions 
            * SDK installer: [VERSION]
            * ASP.NET Core Runtime: [VERSION]
            * .NET Core Runtime: [VERSION]
        * [ ] The change is in an OOB NuGet/NPM/JAR package and was verified against the following version of that package: [PACKAGE ID] [VERSION]

Note: To get the versions of the runtime, add the following middleware to your app and navigate to /.runtime-info:

app.Use(async (context, next) =>
{
    string GetSharedFxVersion(Type type)
    {
        var asmPath = type.Assembly.Location;
        var versionFile = Path.Combine(Path.GetDirectoryName(asmPath), ".version");

        var simpleVersion = File.Exists(versionFile) ?
            File.ReadAllLines(versionFile).Last() :
            "<unknown>";

        var infoVersion = type.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "<unknown>";

        return $"{simpleVersion} ({infoVersion})";
    }

    if (context.Request.Path.StartsWithSegments("/.runtime-info"))
    {
        context.Response.ContentType = "text/plain";
        var aspnetCoreVersion = GetSharedFxVersion(typeof(IApplicationBuilder));
        var netCoreVersion = GetSharedFxVersion(typeof(string));
        await context.Response.WriteAsync($"ASP.NET Core Runtime version: {aspnetCoreVersion}{Environment.NewLine}");
        await context.Response.WriteAsync($".NET Core Runtime version: {netCoreVersion}{Environment.NewLine}");
    }
    else
    {
        await next();
    }
});

This code will work in 2.1, 2.2 and 3.0. The result is something like the below output:

ASP.NET Core Runtime version: 3.0.0-preview5-19227-01 (3.0.0-preview5-19227-01)
.NET Core Runtime version: 3.0.0-preview5-27626-15 (3.0.0-preview5.27622.75+4895a06c0dcc5d13f75dd55bdce83f7792d72ba4)