AnalysisBuilder 類別

定義

IApplicationBuilder用來 AnalysisStartupFilter 在管線中彼此中介軟體前後新增 AnalysisMiddleware 的裝飾專案。

public ref class AnalysisBuilder : Microsoft::AspNetCore::Builder::IApplicationBuilder
public class AnalysisBuilder : Microsoft.AspNetCore.Builder.IApplicationBuilder
type AnalysisBuilder = class
    interface IApplicationBuilder
Public Class AnalysisBuilder
Implements IApplicationBuilder
繼承
AnalysisBuilder
實作

建構函式

AnalysisBuilder(IApplicationBuilder)

初始化 AnalysisBuilder 的新執行個體。

屬性

ApplicationServices

取得或設定 , IServiceProvider 提供應用程式服務容器的存取權。

Properties

取得索引鍵/值集合,可用來在中介軟體之間共用資料。

ServerFeatures

取得應用程式伺服器所提供的 HTTP 功能集。

方法

Build()

建置此應用程式用來處理 HTTP 要求的委派。

New()

建立共用這個 IApplicationBuilder 之 的新 。 IApplicationBuilderProperties

Use(Func<RequestDelegate,RequestDelegate>)

將中介軟體委派新增至應用程式的要求管線。

擴充方法

UseAntiforgery(IApplicationBuilder)

將防偽造中介軟體新增至管線。

UseRequestLocalization(IApplicationBuilder)

新增 以 RequestLocalizationMiddleware 根據用戶端提供的資訊自動設定要求的文化特性資訊。

UseRequestLocalization(IApplicationBuilder, RequestLocalizationOptions)

新增 以 RequestLocalizationMiddleware 根據用戶端提供的資訊自動設定要求的文化特性資訊。

UseRequestLocalization(IApplicationBuilder, Action<RequestLocalizationOptions>)

新增 以 RequestLocalizationMiddleware 根據用戶端提供的資訊自動設定要求的文化特性資訊。

UseRequestLocalization(IApplicationBuilder, String[])

新增 以 RequestLocalizationMiddleware 根據用戶端提供的資訊自動設定要求的文化特性資訊。

UseAuthentication(IApplicationBuilder)

AuthenticationMiddleware 加入至指定的 IApplicationBuilder ,以啟用驗證功能。

UseAuthorization(IApplicationBuilder)

AuthorizationMiddleware 加入至指定的 IApplicationBuilder ,以啟用授權功能。

授權使用端點路由路由路由傳送的資源時,此呼叫必須出現在 呼叫 app.UseRouting()app.UseEndpoints(...) 之間,中介軟體才能正常運作。

UseBrowserLink(IApplicationBuilder)

呼叫這個方法以在應用程式中啟用 Browser Link。 它會註冊處理站方法,以為每個要求建立 BrowserLinkMiddleware。

UseIdentity(IApplicationBuilder)
已淘汰.

此方法已淘汰,將會在未來的版本中移除。 建議的替代方案是 UseAuthentication(IApplicationBuilder)

啟用目前應用程式的 ASP.NET 身分識別。

UseCertificateForwarding(IApplicationBuilder)

將中介軟體新增至管線,以尋找要求標頭中的憑證解碼,並更新 HttpCoNtext.Connection.ClientCertificate。

UseClaimsTransformation(IApplicationBuilder)

ClaimsTransformationMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用宣告轉換功能。

UseClaimsTransformation(IApplicationBuilder, ClaimsTransformationOptions)

ClaimsTransformationMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用宣告轉換功能。

UseClaimsTransformation(IApplicationBuilder, Func<ClaimsTransformationContext,Task<ClaimsPrincipal>>)

ClaimsTransformationMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用宣告轉換功能。

UseBlazorFrameworkFiles(IApplicationBuilder)

將應用程式設定為從根路徑 「/」 提供 Blazor WebAssembly 架構檔案。

UseBlazorFrameworkFiles(IApplicationBuilder, PathString)

設定應用程式以從路徑 pathPrefix 提供 Blazor WebAssembly 架構檔案。 此路徑必須對應至參考的 Blazor WebAssembly 應用程式專案。

UseConcurrencyLimiter(IApplicationBuilder)
已淘汰.

加入 , ConcurrencyLimiterMiddleware 以限制並存執行的要求數目。

UseConnections(IApplicationBuilder, Action<ConnectionsRouteBuilder>)
已淘汰.

將 ASP.NET Core連接處理常式的支援新增至 IApplicationBuilder 要求執行管線。

此方法已淘汰,將會在未來的版本中移除。 建議的替代方法是在 Microsoft.AspNetCore.Builder.UseEndpoints (...) 內使用 MapConnectionHandler 或 MapConnectionHandler TConnectionHandler <> 。

UseCookieAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseCookieAuthentication 已過時。 使用 AddAuthentication () 設定 Cookie 驗證。ConfigureServices 中的 AddCookie。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseCookieAuthentication(IApplicationBuilder, CookieAuthenticationOptions)
已淘汰.
已淘汰.

UseCookieAuthentication 已過時。 使用 AddAuthentication () 設定 Cookie 驗證。ConfigureServices 中的 AddCookie。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseCookieAuthentication(IApplicationBuilder, CookieAuthenticationOptions)

CookieAuthenticationMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用 Cookie 驗證功能。

UseCookiePolicy(IApplicationBuilder)

CookiePolicyMiddleware 處理常式新增至指定的 IApplicationBuilder ,以啟用 Cookie 原則功能。

UseCookiePolicy(IApplicationBuilder, CookiePolicyOptions)

CookiePolicyMiddleware 處理常式新增至指定的 IApplicationBuilder ,以啟用 Cookie 原則功能。

UseCors(IApplicationBuilder)

將 CORS 中介軟體新增至 Web 應用程式管線以允許跨網域要求。

UseCors(IApplicationBuilder, Action<CorsPolicyBuilder>)

將 CORS 中介軟體新增至 Web 應用程式管線以允許跨網域要求。

UseCors(IApplicationBuilder, String)

將 CORS 中介軟體新增至 Web 應用程式管線以允許跨網域要求。

UseDatabaseErrorPage(IApplicationBuilder)
已淘汰.

從管線擷取同步和非同步資料庫相關例外狀況,這些例外狀況可能會使用 Entity Framework 移轉來解析。 發生這些例外狀況時,系統會產生具解決該問題之可能動作詳細資料的 HTML 回應。

UseDatabaseErrorPage(IApplicationBuilder, DatabaseErrorPageOptions)
已淘汰.

從管線擷取同步和非同步資料庫相關例外狀況,這些例外狀況可能會使用 Entity Framework 移轉來解析。 發生這些例外狀況時,系統會產生具解決該問題之可能動作詳細資料的 HTML 回應。

UseDefaultFiles(IApplicationBuilder)

啟用目前路徑上的預設檔案對應

UseDefaultFiles(IApplicationBuilder, DefaultFilesOptions)

使用給定的選項啟用預設檔案對應

UseDefaultFiles(IApplicationBuilder, String)

啟用指定要求路徑的預設檔案對應

UseDeveloperExceptionPage(IApplicationBuilder)

從管線擷取同步和非同步 Exception 實例,並產生 HTML 錯誤回應。

UseDeveloperExceptionPage(IApplicationBuilder, DeveloperExceptionPageOptions)

從管線擷取同步和非同步 Exception 實例,並產生 HTML 錯誤回應。

UseDirectoryBrowser(IApplicationBuilder)

啟用目前路徑上的瀏覽目錄

UseDirectoryBrowser(IApplicationBuilder, DirectoryBrowserOptions)

使用給定的選項啟用目錄瀏覽

UseDirectoryBrowser(IApplicationBuilder, String)

啟用指定要求路徑的瀏覽目錄

UseElmCapture(IApplicationBuilder)

啟用 Elm 記錄服務,其可透過 ElmPageMiddleware 存取。

UseElmPage(IApplicationBuilder)

啟用 檢視 所擷取的 ElmCaptureMiddleware 記錄。

UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>)

Microsoft.AspNetCore.Routing.EndpointMiddleware將中介軟體新增至指定的 IApplicationBuilder ,其中包含從設定 IEndpointRouteBuilderEndpointDataSource 實例所建置的 。 Microsoft.AspNetCore.Routing.EndpointMiddleware將會執行 Endpoint 與目前要求相關聯的 。

UseRouting(IApplicationBuilder)

Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware將中介軟體加入至指定的 IApplicationBuilder

UseExceptionHandler(IApplicationBuilder)

將中介軟體新增至管線,以攔截例外狀況、記錄例外狀況,並在替代管線中重新執行要求。 如果回應已經啟動,則不會重新執行要求。

UseExceptionHandler(IApplicationBuilder, ExceptionHandlerOptions)

將中介軟體新增至管線,以攔截例外狀況、記錄例外狀況,並在替代管線中重新執行要求。 如果回應已經啟動,則不會重新執行要求。

UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>)

將中介軟體新增至管線,以攔截例外狀況、記錄例外狀況,並在替代管線中重新執行要求。 如果回應已經啟動,則不會重新執行要求。

UseExceptionHandler(IApplicationBuilder, String)

將中介軟體新增至管線,以攔截例外狀況、記錄例外狀況、重設要求路徑,然後重新執行要求。 如果回應已經啟動,則不會重新執行要求。

UseExceptionHandler(IApplicationBuilder, String, Boolean)

將中介軟體新增至管線,以攔截例外狀況、記錄例外狀況、重設要求路徑,然後重新執行要求。 如果回應已經啟動,則不會重新執行要求。

UseFacebookAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseUsbAuthentication 已過時。 使用 AddAuthentication () 設定 Facebook 驗證。在 ConfigureServices 中新增Usb。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseFacebookAuthentication(IApplicationBuilder, FacebookOptions)
已淘汰.
已淘汰.

UseUsbAuthentication 已過時。 使用 AddAuthentication () 設定 Facebook 驗證。在 ConfigureServices 中新增Usb。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseFacebookAuthentication(IApplicationBuilder, FacebookOptions)

FacebookMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用 Facebook 驗證功能。

UseFileServer(IApplicationBuilder)

對目前目錄中的目前要求路徑啟用所有靜態檔案中介軟體 (目錄瀏覽除外)。

UseFileServer(IApplicationBuilder, FileServerOptions)

使用給定的選項啟用所有靜態檔案中介軟體

UseFileServer(IApplicationBuilder, Boolean)

對目前目錄中的目前要求路徑啟用所有靜態檔案中介軟體。

UseFileServer(IApplicationBuilder, String)

對同名的目錄中給定的要求路徑啟用所有靜態檔案中介軟體 (目錄瀏覽除外)

UseForwardedHeaders(IApplicationBuilder)

將轉送的標頭套用至目前要求的相符欄位。

根據慣例,HTTP Proxy 會從已知 HTTP 標頭中的用戶端轉送資訊。 會 ForwardedHeadersMiddleware 讀取這些標頭,並在 HttpCoNtext 上填入相關聯的欄位。

UseForwardedHeaders(IApplicationBuilder, ForwardedHeadersOptions)

將轉送的標頭套用至目前要求的相符欄位。

根據慣例,HTTP Proxy 會從已知 HTTP 標頭中的用戶端轉送資訊。 會 ForwardedHeadersMiddleware 讀取這些標頭,並在 HttpCoNtext 上填入相關聯的欄位。

UseGoogleAuthentication(IApplicationBuilder)
已淘汰.

UseGoogleAuthentication 已過時。 使用 AddAuthentication () 設定 Google 驗證。在 ConfigureServices 中新增Google。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseGoogleAuthentication(IApplicationBuilder, GoogleOptions)
已淘汰.

UseGoogleAuthentication 已過時。 使用 AddAuthentication () 設定 Google 驗證。在 ConfigureServices 中新增Google。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseGoogleAuthentication(IApplicationBuilder, GoogleOptions)

GoogleMiddleware 中介軟體新增至指定的 IApplicationBuilder ,這可啟用 Google 驗證功能。

UseHeaderPropagation(IApplicationBuilder)

新增中介軟體,以收集要傳播至 HttpClient 的標頭。

UseHealthChecks(IApplicationBuilder, PathString)

新增提供健康情況檢查狀態的中介軟體。

UseHealthChecks(IApplicationBuilder, PathString, HealthCheckOptions)

新增提供健康情況檢查狀態的中介軟體。

UseHealthChecks(IApplicationBuilder, PathString, Int32)

新增提供健康情況檢查狀態的中介軟體。

UseHealthChecks(IApplicationBuilder, PathString, Int32, HealthCheckOptions)

新增提供健康情況檢查狀態的中介軟體。

UseHealthChecks(IApplicationBuilder, PathString, String)

新增提供健康情況檢查狀態的中介軟體。

UseHealthChecks(IApplicationBuilder, PathString, String, HealthCheckOptions)

新增提供健康情況檢查狀態的中介軟體。

UseHostFiltering(IApplicationBuilder)

新增中介軟體以供允許的主機標頭篩選要求。 不正確要求將會遭到拒絕,且狀態碼為 400。

UseHsts(IApplicationBuilder)

新增使用 HSTS 的中介軟體,這會新增 Strict-Transport-Security 標頭。

UseHttpLogging(IApplicationBuilder)

新增可記錄 HTTP 要求和回應的中介軟體。

UseW3CLogging(IApplicationBuilder)

新增中介軟體,可記錄 W3C 格式之伺服器記錄的 HTTP 要求和回應。

UseHttpMethodOverride(IApplicationBuilder)

允許傳入 POST 要求覆寫標頭中指定的類型的方法類型。 當用戶端僅限於傳送 GET 或 POST 方法,但想要叫用其他 HTTP 方法時,就會使用此中介軟體。 根據預設,會使用 X-HTTP-Method-Override 要求標頭來指定正在通道傳送的 HTTP 方法。

UseHttpMethodOverride(IApplicationBuilder, HttpMethodOverrideOptions)

允許傳入 POST 要求以表單中指定的類型覆寫方法類型。 當用戶端僅限於傳送 GET 或 POST 方法,但想要叫用其他 HTTP 方法時,就會使用此中介軟體。

UseHttpsRedirection(IApplicationBuilder)

將 HTTP 要求重新導向至 HTTPS 的中介軟體。

UseJwtBearerAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseJwtBearerAuthentication 已過時。 使用 AddAuthentication () 設定 JwtBearer 驗證。ConfigureServices 中的 AddJwtBearer。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)
已淘汰.
已淘汰.

UseJwtBearerAuthentication 已過時。 使用 AddAuthentication () 設定 JwtBearer 驗證。ConfigureServices 中的 AddJwtBearer。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

JwtBearerMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用持有人權杖處理功能。 此中介軟體瞭解在要求標頭中顯示的適當格式和保護權杖。 如果 Options.AuthenticationMode 為 Active,持有人權杖內的宣告會新增至目前要求的 IPrincipal User。 如果 Options.AuthenticationMode 是被動的,則不會修改目前的要求,但可以隨時使用 IAuthenticationManager AuthenticationAsync 從要求的持有人權杖取得宣告。 另請參閱 http://tools.ietf.org/html/rfc6749

Map(IApplicationBuilder, PathString, Action<IApplicationBuilder>)

根據指定要求路徑的相符專案來分支要求管線。 如果要求路徑以指定路徑為開頭,則會執行分支。

Map(IApplicationBuilder, PathString, Boolean, Action<IApplicationBuilder>)

根據指定要求路徑的相符專案來分支要求管線。 如果要求路徑以指定路徑為開頭,則會執行分支。

Map(IApplicationBuilder, String, Action<IApplicationBuilder>)

根據指定要求路徑的相符專案來分支要求管線。 如果要求路徑以指定路徑為開頭,則會執行分支。

MapWhen(IApplicationBuilder, Func<HttpContext,Boolean>, Action<IApplicationBuilder>)

根據給定的述詞結果分支要求管線。

UseMicrosoftAccountAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseMicrosoftAccountAuthentication 已過時。 使用 AddAuthentication () 設定 MicrosoftAccount 驗證。在 ConfigureServices 中新增MicrosoftAccount。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseMicrosoftAccountAuthentication(IApplicationBuilder, MicrosoftAccountOptions)
已淘汰.
已淘汰.

UseMicrosoftAccountAuthentication 已過時。 使用 AddAuthentication () 設定 MicrosoftAccount 驗證。在 ConfigureServices 中新增MicrosoftAccount。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseMicrosoftAccountAuthentication(IApplicationBuilder, MicrosoftAccountOptions)

MicrosoftAccountMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用 Microsoft 帳戶驗證功能。

UseMigrationsEndPoint(IApplicationBuilder)

處理執行移轉作業的要求。 中介軟體會接聽對 DefaultPath 提出的要求。

UseMigrationsEndPoint(IApplicationBuilder, MigrationsEndPointOptions)

處理執行移轉作業的要求。 中介軟體會接聽 中 options 設定路徑的要求。

UseMvc(IApplicationBuilder)

將 MVC 新增至 IApplicationBuilder 要求執行管線。

UseMvc(IApplicationBuilder, Action<IRouteBuilder>)

將 MVC 新增至 IApplicationBuilder 要求執行管線。

UseMvcWithDefaultRoute(IApplicationBuilder)

使用名為 'default' 的預設路由和下列範本,將 MVC 新增至 IApplicationBuilder 要求執行管線:'{controller=Home}/{action=Index}/{id?}'。

UseOAuthAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseOAuthAuthentication 已過時。 使用 AddAuthentication () 設定 OAuth 驗證。ConfigureServices 中的 AddOAuth。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseOAuthAuthentication(IApplicationBuilder, OAuthOptions)
已淘汰.
已淘汰.

UseOAuthAuthentication 已過時。 使用 AddAuthentication () 設定 OAuth 驗證。ConfigureServices 中的 AddOAuth。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseOAuthAuthentication(IApplicationBuilder, OAuthOptions)

OAuthMiddleware<TOptions> 中介軟體新增至指定的 IApplicationBuilder ,以啟用 OAuth 2.0 驗證功能。

UseOpenIdConnectAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

UseOpenIdConnectAuthentication 已過時。 使用 AddAuthentication () 設定 OpenIdConnect 驗證。ConfigureServices 中的 AddOpenIdConnect。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseOpenIdConnectAuthentication(IApplicationBuilder, OpenIdConnectOptions)
已淘汰.
已淘汰.

UseOpenIdConnectAuthentication 已過時。 使用 AddAuthentication () 設定 OpenIdConnect 驗證。ConfigureServices 中的 AddOpenIdConnect。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseOpenIdConnectAuthentication(IApplicationBuilder, OpenIdConnectOptions)

OpenIdConnectMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用 OpenID Connect 驗證功能。

UseOutputCache(IApplicationBuilder)

IApplicationBuilder用來 AnalysisStartupFilter 在管線中彼此中介軟體前後新增 AnalysisMiddleware 的裝飾專案。

UseOwin(IApplicationBuilder)

將 OWIN 管線新增至指定的 IApplicationBuilder

UseOwin(IApplicationBuilder, Action<Action<Func<Func<IDictionary<String,Object>,Task>,Func<IDictionary<String,Object>,Task>>>>)

將 OWIN 中介軟體管線新增至指定的 IApplicationBuilder

RunProxy(IApplicationBuilder)

如選項中所指定,將要求傳送至遠端伺服器

RunProxy(IApplicationBuilder, ProxyOptions)

如選項中所指定,將要求傳送至遠端伺服器

UseRateLimiter(IApplicationBuilder)

啟用應用程式的速率限制。

UseRateLimiter(IApplicationBuilder, RateLimiterOptions)

啟用應用程式的速率限制。

UseRequestDecompression(IApplicationBuilder)

新增用於動態解壓縮 HTTP 要求主體的中介軟體。

UseRequestTimeouts(IApplicationBuilder)

啟用應用程式的要求逾時。

預設不會設定逾時。 它們必須在 RequestTimeoutOptions 、端點 RequestTimeoutAttribute 上設定,或使用 WithRequestTimeout 路由延伸模組。

UseResponseBuffering(IApplicationBuilder)

啟用回應主體的完整緩衝處理。 您可以使用 IHttpBufferingFeature,根據每個要求停用此功能。

UseResponseCaching(IApplicationBuilder)

ResponseCachingMiddleware加入快取 HTTP 回應的 。

UseResponseCompression(IApplicationBuilder)

新增用於動態壓縮 HTTP 回應的中介軟體。

UseRewriter(IApplicationBuilder)

檢查指定的 URL 是否符合規則和條件,並在相符時修改 HttpCoNtext。

UseRewriter(IApplicationBuilder, RewriteOptions)

檢查指定的 URL 是否符合規則和條件,並在相符時修改 HttpCoNtext。

UseRouter(IApplicationBuilder, IRouter)

使用 RouterMiddleware 指定的 ,將中介軟體加入至指定的 IRouterIApplicationBuilder

UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

使用 RouterMiddleware 從設定的 建置 ,將中介軟體加入至指定的 IApplicationBuilderIRouterIRouteBuilder

Run(IApplicationBuilder, RequestDelegate)

將終端機中介軟體委派新增至應用程式的要求管線。

UseSession(IApplicationBuilder)

SessionMiddleware新增 以自動啟用應用程式的會話狀態。

UseSession(IApplicationBuilder, SessionOptions)

SessionMiddleware新增 以自動啟用應用程式的會話狀態。

UseSignalR(IApplicationBuilder, Action<HubRouteBuilder>)
已淘汰.

將 SignalR 新增至 IApplicationBuilder 要求執行管線。

此方法已淘汰,將會在未來的版本中移除。 建議的替代方法是在 Microsoft.AspNetCore.Builder.UseEndpoints 內部使用 MapHub < THub > (...) 。

UseSpa(IApplicationBuilder, Action<ISpaBuilder>)

藉由傳回單一頁面應用程式的預設頁面 (SPA) ,處理中介軟體鏈結中這個點的所有要求。

此中介軟體應該在鏈結中晚期放置,讓其他用於提供靜態檔案、MVC 動作等的中介軟體優先。

UseStaticFiles(IApplicationBuilder)

啟用目前要求路徑的靜態檔案服務

UseStaticFiles(IApplicationBuilder, StaticFileOptions)

使用給定的選項啟用靜態檔案提供

UseStaticFiles(IApplicationBuilder, String)

啟用指定要求路徑的靜態檔案服務

UseStatusCodePages(IApplicationBuilder)

新增具有預設回應處理常式的 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有主體的回應。

UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions)

新增具有指定選項的 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有本文的回應。

UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>)

使用指定的替代中介軟體管線,將 StatusCodePages 中介軟體新增至管線,以產生回應本文。

UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>)

新增具有指定處理常式的 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有本文的回應。

UseStatusCodePages(IApplicationBuilder, String, String)

加入具有要傳送之指定回應本文的 StatusCodePages 中介軟體。 這可能包括狀態碼的 ' {0} ' 預留位置。 中介軟體會檢查狀態碼介於 400 到 599 之間沒有主體的回應。

UseStatusCodePagesWithRedirects(IApplicationBuilder, String)

將 StatusCodePages 中介軟體新增至管線。 指定應該使用指定的位置 URL 範本重新導向來處理回應。 這可能包括狀態碼的 ' {0} ' 預留位置。 開頭為 '~' 的 URL 前面會加上 PathBase,其中任何其他 URL 都會如往常使用。

UseStatusCodePagesWithReExecute(IApplicationBuilder, String, String)

將 StatusCodePages 中介軟體新增至管線。 指定應由透過使用替代路徑來重新執行要求管線的方法,產生回應主體。 此路徑可能包含狀態碼的 ' {0} ' 預留位置。

UseTwitterAuthentication(IApplicationBuilder)
已淘汰.
已淘汰.

使用TwitterAuthentication 已過時。 使用 AddAuthentication () 設定 Twitter 驗證。在 ConfigureServices 中新增 Windows。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseTwitterAuthentication(IApplicationBuilder, TwitterOptions)
已淘汰.
已淘汰.

使用TwitterAuthentication 已過時。 使用 AddAuthentication () 設定 Twitter 驗證。在 ConfigureServices 中新增 Windows。 如需更多詳細資料,請參閱 https://go.microsoft.com/fwlink/?linkid=845470 \(英文\)。

UseTwitterAuthentication(IApplicationBuilder, TwitterOptions)

TwitterMiddleware 中介軟體新增至指定的 IApplicationBuilder ,以啟用 Twitter 驗證功能。

Use(IApplicationBuilder, Func<HttpContext,RequestDelegate,Task>)

將內嵌定義的中介軟體委派新增至應用程式的要求管線。 如果您未呼叫下一個函式,請改用 Run(IApplicationBuilder, RequestDelegate)

Use(IApplicationBuilder, Func<HttpContext,Func<Task>,Task>)

將內嵌定義的中介軟體委派新增至應用程式的要求管線。 如果您未呼叫下一個函式,請改用 Run(IApplicationBuilder, RequestDelegate)

偏好使用 Use(IApplicationBuilder, Func<HttpContext,RequestDelegate,Task>) 以提升效能,如下所示:

app.Use((context, next) =>
{
    return next(context);
});
UseMiddleware(IApplicationBuilder, Type, Object[])

將中介軟體類型新增至應用程式的要求管線。

UseMiddleware<TMiddleware>(IApplicationBuilder, Object[])

將中介軟體類型新增至應用程式的要求管線。

UsePathBase(IApplicationBuilder, PathString)

將中介軟體從要求路徑擷取指定的路徑基底,並將它貼到要求路徑基底。

UseWhen(IApplicationBuilder, Func<HttpContext,Boolean>, Action<IApplicationBuilder>)

有條件地在要求管線中建立分支,該分支會重新加入主要管線。

UseWebAssemblyDebugging(IApplicationBuilder)

在Chromium開發工具內新增偵錯 Blazor WebAssembly 應用程式所需的中介軟體。

UseWebpackDevMiddleware(IApplicationBuilder, WebpackDevMiddlewareOptions)
已淘汰.

啟用 Webpack 開發中介軟體支援。 這會在應用程式中的記憶體中裝載 Webpack 編譯器的實例,以便您隨時都能提供最新的 Webpack 建置資源,而不需要手動執行編譯器。 由於 Webpack 編譯器實例會保留在記憶體中,因此從頭開始重新執行編譯器的速度會大幅加快增量編譯。

不論磁片上的檔案為何,都會直接傳回 Webpack 編譯器輸出來處理符合 Webpack 建置檔案的傳入要求。 如果要求送達時正在進行編譯,回應會暫停,直到更新的編譯器輸出就緒為止。

UseWebSockets(IApplicationBuilder)

WebSocketMiddleware 加入至要求管線。

UseWebSockets(IApplicationBuilder, WebSocketOptions)

WebSocketMiddleware 加入至要求管線。

UseWelcomePage(IApplicationBuilder)

將 WelcomePageMiddleware 新增至管線。

UseWelcomePage(IApplicationBuilder, WelcomePageOptions)

使用給定的選項將 WelcomePageMiddleware 新增至管線。

UseWelcomePage(IApplicationBuilder, PathString)

新增 WelcomePageMiddleware 和指定路徑至管線。

UseWelcomePage(IApplicationBuilder, String)

新增 WelcomePageMiddleware 和指定路徑至管線。

UseHttpLoggingMiddleware(IApplicationBuilder)

將傳入的 HTTP 要求記錄中介軟體註冊到 IApplicationBuilder

UseRequestCheckpoint(IApplicationBuilder)

向管線註冊要求檢查點相關中介軟體。

UseRequestLatencyTelemetry(IApplicationBuilder)

將要求延遲遙測中介軟體新增至 IApplicationBuilder 要求執行管線。

UseSpaStaticFiles(IApplicationBuilder)

設定應用程式來提供單頁應用程式 (SPA) 的靜態檔案。 檔案將使用已註冊 ISpaStaticFileProvider 的服務找到。

UseSpaStaticFiles(IApplicationBuilder, StaticFileOptions)

設定應用程式來提供單頁應用程式 (SPA) 的靜態檔案。 檔案將使用已註冊 ISpaStaticFileProvider 的服務找到。

適用於