Skip to content

Commit

Permalink
fix: MD031/blanks-around-fences (#11605)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni authored and scottaddie committed Mar 20, 2019
1 parent f521ff4 commit d6246ca
Show file tree
Hide file tree
Showing 35 changed files with 136 additions and 89 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ DocFX requires:
```console
docfx --serve
```

* In a browser, navigate to `http://localhost:8080/group1-dest/`.

### Mono instructions
Expand All @@ -128,6 +129,7 @@ DocFX requires:
```console
brew install mono
```

* Download the [latest version of DocFX](https://github.com/dotnet/docfx/releases).
* Extract the archive to *$HOME/bin/docfx*.
* Create a pair of aliases for **docfx** in a bash shell. The first alias is used to build the documentation. The second alias is used to build and serve the documentation.
Expand All @@ -136,11 +138,13 @@ DocFX requires:
alias docfx='mono $HOME/bin/docfx/docfx.exe'
alias docfx-serve='mono $HOME/bin/docfx/docfx.exe --serve'
```

* In a command shell, navigate to the folder that contains the *docfx.json* file (*aspnet* for ASP.NET content or *aspnetcore* for ASP.NET Core content) and run the following command to build and serve the docs via its alias:

```console
docfx-serve
```

* In a browser, navigate to `http://localhost:8080/group1-dest/`.

## Voice and tone
Expand Down
7 changes: 7 additions & 0 deletions aspnetcore/azure/devops/cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,23 @@ In this section, you'll complete the following tasks:
1. Click the **Create repository** button.
1. Open your local machine's command shell. Navigate to the directory in which the *simple-feed-reader* Git repository is stored.
1. Rename the existing *origin* remote to *upstream*. Execute the following command:

```console
git remote rename origin upstream
```

1. Add a new *origin* remote pointing to your copy of the repository on GitHub. Execute the following command:

```console
git remote add origin https://github.com/<GitHub_username>/simple-feed-reader/
```

1. Publish your local Git repository to the newly created GitHub repository. Execute the following command:

```console
git push -u origin master
```

1. Open a browser window, and navigate to `https://github.com/<GitHub_username>/simple-feed-reader/`. Validate that your code appears in the GitHub repository.

## Disconnect local Git deployment
Expand Down Expand Up @@ -186,6 +192,7 @@ There are three distinct steps to complete. Completing the steps in the followin
```console
git commit -a -m "upgraded to V4"
```

1. Push the change in the *master* branch to the *origin* remote of your GitHub repository:

```console
Expand Down
1 change: 1 addition & 0 deletions aspnetcore/azure/devops/deploying-to-app-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Deployment slots support the staging of changes without impacting the app runnin
```console
git commit -a -m "upgraded to V3"
```

5. Using the local machine's command shell, add the staging deployment URL as a Git remote and push the committed changes:

a. Add the remote URL for staging to the local Git repository.
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/client-side/spa/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ There's a drawback to this default setup. Each time you modify your C# code and
```
BROWSER=none
```
This will prevent your web browser from opening when starting the CRA server externally.
2. In a command prompt, switch to the *ClientApp* subdirectory, and launch the CRA development server:
Expand Down
2 changes: 2 additions & 0 deletions aspnetcore/data/ef-mvc/complex-data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public ICollection<Course> Courses { get; set; }

> [!NOTE]
> By convention, the Entity Framework enables cascade delete for non-nullable foreign keys and for many-to-many relationships. This can result in circular cascade delete rules, which will cause an exception when you try to add a migration. For example, if you didn't define the Department.InstructorID property as nullable, EF would configure a cascade delete rule to delete the instructor when you delete the department, which isn't what you want to have happen. If your business rules required the `InstructorID` property to be non-nullable, you would have to use the following fluent API statement to disable cascade delete on the relationship:
>
> ```csharp
> modelBuilder.Entity<Department>()
> .HasOne(d => d.Administrator)
Expand Down Expand Up @@ -476,6 +477,7 @@ Save your change to *appsettings.json*.

> [!NOTE]
> As an alternative to changing the database name, you can delete the database. Use **SQL Server Object Explorer** (SSOX) or the `database drop` CLI command:
>
> ```console
> dotnet ef database drop
> ```
Expand Down
1 change: 1 addition & 0 deletions aspnetcore/data/ef-mvc/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ This change sets up the project so that the first migration will create a new da

> [!NOTE]
> As an alternative to changing the database name, you can delete the database. Use **SQL Server Object Explorer** (SSOX) or the `database drop` CLI command:
>
> ```console
> dotnet ef database drop
> ```
Expand Down
1 change: 1 addition & 0 deletions aspnetcore/data/ef-rp/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --version 2.
dotnet tool install --global dotnet-aspnet-codegenerator
dotnet aspnet-codegenerator razorpage -m Student -dc ContosoUniversity.Models.SchoolContext -udl -outDir Pages/Students --referenceScriptLibraries
```

------

The scaffold process created and changed the following files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ To run the sample:
<RestoreSources>$(RestoreSources);https://api.nuget.org/v3/index.json;../HostingStartupPackage/bin/Debug</RestoreSources>
</PropertyGroup>
```

1. Observe that the service configuration key values rendered by the Index page match the values set by the package's `ServiceKeyInjection.Configure` method.

If you make changes to the *HostingStartupPackage* project and recompile it, clear the local NuGet package caches to ensure that the *HostingStartupApp* receives the updated package and not a stale package from the local cache. To clear the local NuGet caches, execute the following [dotnet nuget locals](/dotnet/core/tools/dotnet-nuget-locals) command:
Expand All @@ -368,6 +369,7 @@ dotnet nuget locals all --clear
</Reference>
</ItemGroup>
```

1. Observe that the service configuration key values rendered by the Index page match the values set by the class library's `ServiceKeyInjection.Configure` method.

**Activation from a runtime store-deployed assembly**
Expand All @@ -381,6 +383,7 @@ dotnet nuget locals all --clear
```console
dotnet store --manifest StartupDiagnostics.csproj --runtime <RID>
```

For Windows, the command uses the `win7-x64` [runtime identifier (RID)](/dotnet/core/rid-catalog). When providing the hosting startup for a different runtime, substitute the correct RID.
1. Set the environment variables:
* Add the assembly name of *StartupDiagnostics* to the `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` environment variable.
Expand Down
28 changes: 14 additions & 14 deletions aspnetcore/host-and-deploy/aspnet-core-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The following characteristics apply when hosting in-process:
* In ASP.NET Core 2.2.1 or earlier, <xref:System.IO.Directory.GetCurrentDirectory*> returns the worker directory of the process started by IIS rather than the app's directory (for example, *C:\Windows\System32\inetsrv* for *w3wp.exe*).

For sample code that sets the app's current directory, see the [CurrentDirectoryHelpers class](https://github.com/aspnet/Docs/tree/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs). Call the `SetCurrentDirectory` method. Subsequent calls to <xref:System.IO.Directory.GetCurrentDirectory*> provide the app's directory.

* When hosting in-process, <xref:Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync*> isn't called internally to initialize a user. Therefore, an <xref:Microsoft.AspNetCore.Authentication.IClaimsTransformation> implementation used to transform claims after every authentication isn't activated by default. When transforming claims with an <xref:Microsoft.AspNetCore.Authentication.IClaimsTransformation> implementation, call <xref:Microsoft.Extensions.DependencyInjection.AuthenticationServiceCollectionExtensions.AddAuthentication*> to add authentication services:

```csharp
Expand All @@ -75,7 +75,7 @@ The following characteristics apply when hosting in-process:
services.AddTransient<IClaimsTransformation, ClaimsTransformer>();
services.AddAuthentication(IISServerDefaults.AuthenticationScheme);
}

public void Configure(IApplicationBuilder app)
{
app.UseAuthentication();
Expand Down Expand Up @@ -167,10 +167,10 @@ The following *web.config* file is published for a [framework-dependent deployme
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\MyApp.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
<aspNetCore processPath="dotnet"
arguments=".\MyApp.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="InProcess" />
</system.webServer>
</location>
Expand All @@ -188,9 +188,9 @@ The following *web.config* file is published for a [framework-dependent deployme
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\MyApp.dll"
stdoutLogEnabled="false"
<aspNetCore processPath="dotnet"
arguments=".\MyApp.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
Expand All @@ -210,9 +210,9 @@ The following *web.config* is published for a [self-contained deployment](/dotne
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\MyApp.exe"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
<aspNetCore processPath=".\MyApp.exe"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="InProcess" />
</system.webServer>
</location>
Expand All @@ -232,8 +232,8 @@ The <xref:System.Configuration.SectionInformation.InheritInChildApplications*> p
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\MyApp.exe"
stdoutLogEnabled="false"
<aspNetCore processPath=".\MyApp.exe"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
Expand Down
3 changes: 3 additions & 0 deletions aspnetcore/host-and-deploy/azure-apps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ When the operation completes, the latest .NET Core preview is installed. Verify
```powershell
Test-Path D:\home\SiteExtensions\AspNetCoreRuntime.{X.Y}.{PLATFORM}\
```

The command returns `True` when the x64 preview runtime is installed.

> [!NOTE]
Expand Down Expand Up @@ -194,11 +195,13 @@ When deploying a self-contained app:
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
```
1. From a command shell, publish the app in Release configuration for the host's runtime with the [dotnet publish](/dotnet/core/tools/dotnet-publish) command. In the following example, the app is published for the `win-x86` RID. The RID supplied to the `--runtime` option must be provided in the `<RuntimeIdentifier>` (or `<RuntimeIdentifiers>`) property in the project file.

```console
dotnet publish --configuration Release --runtime win-x86
```

1. Move the contents of the *bin/Release/{TARGET FRAMEWORK}/{RUNTIME IDENTIFIER}/publish* directory to the site in App Service.

### Use Docker with Web Apps for containers
Expand Down
12 changes: 7 additions & 5 deletions aspnetcore/host-and-deploy/azure-apps/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This article provides instructions on how to diagnose an ASP.NET Core app startu

## App startup errors

**502.5 Process Failure**
**502.5 Process Failure**
The worker process fails. The app doesn't start.

The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module) attempts to start the worker process but it fails to start. Examining the Application Event Log often helps troubleshoot this type of problem. Accessing the log is explained in the [Application Event Log](#application-event-log) section.
Expand All @@ -26,7 +26,8 @@ The *502.5 Process Failure* error page is returned when a misconfigured app caus

![Browser window showing the 502.5 Process Failure page](troubleshoot/_static/process-failure-page.png)

**500 Internal Server Error**
**500 Internal Server Error**

The app starts, but an error prevents the server from fulfilling the request.

This error occurs within the app's code during startup or while creating a response. The response may contain no content, or the response may appear as a *500 Internal Server Error* in the browser. The Application Event Log usually states that the app started normally. From the server's perspective, that's correct. The app did start, but it can't generate a valid response. [Run the app in the Kudu console](#run-the-app-in-the-kudu-console) or [enable the ASP.NET Core Module stdout log](#aspnet-core-module-stdout-log) to troubleshoot the problem.
Expand Down Expand Up @@ -77,14 +78,15 @@ Many startup errors don't produce useful information in the Application Event Lo
```console
dotnet .\{ASSEMBLY NAME}.dll
```

* If the app is a [self-contained deployment](/dotnet/core/deploying/#self-contained-deployments-scd):

```console
{ASSEMBLY NAME}.exe
```

The console output from the app, showing any errors, is piped to the Kudu console.

##### Framework-dependent deployment running on a preview release

*Requires installing the ASP.NET Core {VERSION} (x86) Runtime site extension.*
Expand Down Expand Up @@ -224,7 +226,7 @@ Proceed to activate diagnostic logging:

1. In the Azure portal, select the **Diagnostics logs** blade.
1. Select the **On** switch for **Application Logging (Filesystem)** and **Detailed error messages**. Select the **Save** button at the top of the blade.
1. To include failed request tracing, also known as Failed Request Event Buffering (FREB) logging, select the **On** switch for **Failed request tracing**.
1. To include failed request tracing, also known as Failed Request Event Buffering (FREB) logging, select the **On** switch for **Failed request tracing**.
1. Select the **Log stream** blade, which is listed immediately under the **Diagnostics logs** blade in the portal.
1. Make a request to the app.
1. Within the log stream data, the cause of the error is indicated.
Expand Down
6 changes: 3 additions & 3 deletions aspnetcore/host-and-deploy/azure-iis-errors-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Non-OS files in the **C:\Windows\SysWOW64\inetsrv** directory aren't preserved d

*Applies to apps hosted by Azure App Services.*

* **Browser:** HTTP Error 500.0 - ANCM In-Process Handler Load Failure
* **Browser:** HTTP Error 500.0 - ANCM In-Process Handler Load Failure

* **Application Log:** Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. Could not find inprocess request handler. Captured output from invoking hostfxr: It was not possible to find any compatible framework version. The specified framework 'Microsoft.AspNetCore.App', version '{VERSION}-preview-\*' was not found. Failed to start application '/LM/W3SVC/1416782824/ROOT', ErrorCode '0x8000ffff'.

Expand All @@ -74,7 +74,7 @@ Troubleshooting:
* ASP.NET Core {RUNTIME VERSION} (x86) Runtime
* ASP.NET Core {RUNTIME VERSION} (x64) Runtime

Restart the app. Wait several seconds for the app to restart.
Restart the app. Wait several seconds for the app to restart.

* If running the app on a preview runtime and both the 32-bit (x86) and 64-bit (x64) [site extensions](xref:host-and-deploy/azure-apps/index#install-the-preview-site-extension) are installed, uninstall the site extension that doesn't match the bitness of the app. After removing the site extension, restart the app. Wait several seconds for the app to restart.

Expand Down Expand Up @@ -195,7 +195,7 @@ Troubleshooting:
```xml
<section name="aspNetCore" overrideModeDefault="Allow" />
```

Alternatively, install the latest version of the ASP.NET Core Hosting Bundle. The latest version is backwards-compatible with supported ASP.NET Core apps.

## Incorrect processPath, missing PATH variable, Hosting Bundle not installed, system/IIS not restarted, VC++ Redistributable not installed, or dotnet.exe access violation
Expand Down
32 changes: 16 additions & 16 deletions aspnetcore/host-and-deploy/health-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class ExampleHealthCheck : IHealthCheck
}

public Task<HealthCheckResult> CheckHealthAsync(
HealthCheckContext context,
HealthCheckContext context,
CancellationToken cancellationToken = default(CancellationToken))
{
// Execute health check logic here. This example sets a dummy
Expand Down Expand Up @@ -124,8 +124,8 @@ The <xref:Microsoft.Extensions.DependencyInjection.HealthChecksBuilderAddCheckEx
```csharp
services.AddHealthChecks()
.AddCheck<ExampleHealthCheck>(
"example_health_check",
failureStatus: HealthStatus.Degraded,
"example_health_check",
failureStatus: HealthStatus.Degraded,
tags: new[] { "example" });
```

Expand All @@ -135,7 +135,7 @@ services.AddHealthChecks()
public void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks()
.AddCheck("Example", () =>
.AddCheck("Example", () =>
HealthCheckResult.Healthy("Example is OK!"), tags: new[] { "example" })
}
```
Expand Down Expand Up @@ -180,11 +180,11 @@ using Microsoft.Extensions.Diagnostics.HealthChecks;
public void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks()
.AddCheck("Foo", () =>
.AddCheck("Foo", () =>
HealthCheckResult.Healthy("Foo is OK!"), tags: new[] { "foo_tag" })
.AddCheck("Bar", () =>
.AddCheck("Bar", () =>
HealthCheckResult.Unhealthy("Bar is unhealthy!"), tags: new[] { "bar_tag" })
.AddCheck("Baz", () =>
.AddCheck("Baz", () =>
HealthCheckResult.Healthy("Baz is OK!"), tags: new[] { "baz_tag" });
}

Expand All @@ -193,7 +193,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseHealthChecks("/health", new HealthCheckOptions()
{
// Filter out the 'Bar' health check. Only Foo and Baz execute.
Predicate = (check) => check.Tags.Contains("foo_tag") ||
Predicate = (check) => check.Tags.Contains("foo_tag") ||
check.Tags.Contains("baz_tag")
});
}
Expand Down Expand Up @@ -258,7 +258,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
});
}

private static Task WriteResponse(HttpContext httpContext,
private static Task WriteResponse(HttpContext httpContext,
HealthReport result)
{
httpContext.Response.ContentType = "application/json";
Expand Down Expand Up @@ -609,11 +609,11 @@ To distribute a health check as a library:
const string NAME = "example_health_check";

public static IHealthChecksBuilder AddExampleHealthCheck(
this IHealthChecksBuilder builder,
string name = default,
string data1,
int data2 = 1,
HealthStatus? failureStatus = default,
this IHealthChecksBuilder builder,
string name = default,
string data1,
int data2 = 1,
HealthStatus? failureStatus = default,
IEnumerable<string> tags = default)
{
return builder.Add(new HealthCheckRegistration(
Expand Down Expand Up @@ -663,11 +663,11 @@ In the sample app's `LivenessProbeStartup` example, the `StartupHostedService` r
> The following workaround permits adding an <xref:Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheckPublisher> instance to the service container when one or more other hosted services have already been added to the app. This workaround won't be required with the release of ASP.NET Core 3.0. For more information, see: https://github.com/aspnet/Extensions/issues/639.
>
> ```csharp
> private const string HealthCheckServiceAssembly =
> private const string HealthCheckServiceAssembly =
> "Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckPublisherHostedService";
>
> services.TryAddEnumerable(
> ServiceDescriptor.Singleton(typeof(IHostedService),
> ServiceDescriptor.Singleton(typeof(IHostedService),
> typeof(HealthCheckPublisherOptions).Assembly
> .GetType(HealthCheckServiceAssembly)));
> ```
Expand Down
Loading

0 comments on commit d6246ca

Please sign in to comment.