WebApplicationFactoryContentRootAttribute WebApplicationFactoryContentRootAttribute WebApplicationFactoryContentRootAttribute WebApplicationFactoryContentRootAttribute Class

Definition

Metadata that WebApplicationFactory<TEntryPoint> uses to find out the content root for the web application represented by TEntryPoint. WebApplicationFactory<TEntryPoint> will iterate over all the instances of WebApplicationFactoryContentRootAttribute, filter the instances whose Key is equal to TEntryPointFullName, order them by Priority in ascending order. WebApplicationFactory<TEntryPoint> will check for the existence of the marker in

Path.Combine(ContentRootPath, Path.GetFileName(ContentRootTest))"
and if the file exists it will set the content root to ContentRootPath.

public ref class WebApplicationFactoryContentRootAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed class WebApplicationFactoryContentRootAttribute : Attribute
type WebApplicationFactoryContentRootAttribute = class
    inherit Attribute
Public NotInheritable Class WebApplicationFactoryContentRootAttribute
Inherits Attribute
Inheritance
WebApplicationFactoryContentRootAttributeWebApplicationFactoryContentRootAttributeWebApplicationFactoryContentRootAttributeWebApplicationFactoryContentRootAttribute
Attributes

Constructors

WebApplicationFactoryContentRootAttribute(String, String, String, String) WebApplicationFactoryContentRootAttribute(String, String, String, String) WebApplicationFactoryContentRootAttribute(String, String, String, String) WebApplicationFactoryContentRootAttribute(String, String, String, String)

Initializes a new instance of WebApplicationFactoryContentRootAttribute.

Properties

ContentRootPath ContentRootPath ContentRootPath ContentRootPath

Gets the content root path for a given project. This content root can be relative or absolute. If it is a relative path, it will be combined with BaseDirectory.

ContentRootTest ContentRootTest ContentRootTest ContentRootTest

A marker file used to ensure that the path the content root is being set to is correct.

Key Key Key Key

Gets the key for the content root associated with this project. Typically FullName.

Priority Priority Priority Priority

Gets a number for determining the probing order when multiple WebApplicationFactoryContentRootAttribute instances with the same key are present on the test Assembly.

Applies to