 *web.config* file, which is normally produced when publishing an ASP.NET Core app, is unnecessary for a Windows Services app. To disable the creation of the *web.config* file, add the `<IsTransformWebConfigDisabled>` property set to `true`.  ```xml <PropertyGroup>   <TargetFramework>netcoreapp0.0</TargetFramework>   <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> </PropertyGroup> ```  ### Self-contained deployment (SCD)  Self-contained deployment (SCD) doesn't rely on the presence of a shared framework on the host system. The runtime and the app's dependencies are deployed with the app.  A Windows [Runtime Identifier (RID)](/dotnet/core/rid-catalog) is included in the `<PropertyGroup>` that contains the target framework:  ```xml <RuntimeIdentifier>win0-x00</RuntimeIdentifier> ```  To publish for multiple RIDs:  * Provide the RIDs in a semicolon-delimited list. * Use the property name [\<RuntimeIdentifiers>](/dotnet/core/tools/csproj#runtimeidentifiers) (plural).  For more information, see [.NET Core RID Catalog](/dotnet/core/rid-catalog).  ## Service user account  To create a user account for a service, use the [New-LocalUser](/powershell/module/microsoft.powershell.localaccounts/new-localuser) cmdlet from an administrative PowerShell 0 command shell.  On Windows 00 October 0000 Update (version 0000/build 00.0.00000) or later:  ```powershell New-LocalUser -Name {SERVICE NAME} ```  On Windows OS earlier than the Windows 00 October 0000 Update (version 0000/build 00.0.00000):  ```console powershell -Command "New-LocalUser -Name {SERVICE NAME}" ```  Provide a [strong password](/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements) when prompted.  Unless the `-AccountExpires` parameter is supplied to the [New-LocalUser](/powershell/module/microsoft.powershell.localaccounts/new-localuser) cmdlet with an expiration <xref:System.DateTime>, the account doesn't expire.  For more information, see [Microsoft.PowerShell.LocalAccounts](/powershell/module/microsoft.powershell.localaccounts/) and [Service User Accounts](/windows/desktop/services/service-user-accounts).  An alternative approach to managing users when using Active Directory is to use Managed Service Accounts. For more information, see [Group Managed Service Accounts Overview](/windows-server/security/group-managed-service-accounts/group-managed-service-accounts-overview).  ## Log on as a service rights  To establish *Log on as a service* rights for a service user account:  0. Open the Local Security Policy editor by running *secpol.msc*. 0. Expand the **Local Policies** node and select **User Rights Assignment**. 0. Open the **Log on as a service** policy. 0. Select **Add User or Group**. 0. Provide the object name (user account) using either of the following approaches:    0. Type the user account (`{DOMAIN OR COMPUTER NAME\USER}`) in the object name field and select **OK** to add the user to the policy.    0. Select **Advanced**. Select **Find Now**. Select the user account from the list. Select **OK**. Select **OK** again to add the user to the policy. 0. Select **OK** or **Apply** to accept the changes.  ## Create and manage the Windows Service  ### Create a service  Use PowerShell commands to register a service. From an administrative PowerShell 0 command shell, execute the following commands:  ```powershell $acl = Get-Acl "{EXE PATH}" $aclRuleArgs = {DOMAIN OR COMPUTER NAME\USER}, "Read,Write,ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow" $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($aclRuleArgs) $acl.SetAccessRule($accessRule) $acl | Set-Acl "{EXE PATH}"  New-Service -Name {SERVICE NAME} -BinaryPathName {EXE FILE PATH} -Credential {DOMAIN OR COMPUTER NAME\USER} -Description "{DESCRIPTION}" -DisplayName "{DISPLAY NAME}" -StartupType Automatic ```  * `{EXE PATH}`: Path to the app's folder on the host (for example, `d:\myservice`). Don't include the app's executable in the path. A trailing slash isn't required. * `{DOMAIN OR COMPUTER NAME\USER}`: Service user account (for example, `Contoso\ServiceUser`). * `{SERVICE NAME}`: Service name (for example, `MyService`). * `{EXE FILE PATH}`: The app's executable path (for example, `d:\myservice\myservice.exe`). Include the executable's file name with extension. * `{DESCRIPTION}`: Service description (for example, `My sample service`). * `{DISPLAY NAME}`: Service display name (for example, `My Service`).  ### Start a service  Start a service with the following PowerShell 0 command:  ```powershell Start-Service -Name {SERVICE NAME} ```  The command takes a few seconds to start the service.  ### Determine a service's status  To check the status of a service, use the following PowerShell 0 command:  ```powershell Get-Service -Name {SERVICE NAME} ```  The status is reported as one of the following values:  * `Starting` * `Running` * `Stopping` * `Stopped`  ### Stop a service  Stop a service with the following Powershell 0 command:  ```powershell Stop-Service -Name {SERVICE NAME} ```  ### Remove a service  After a short delay to stop a service, remove a service with the following Powershell 0 command:  ```powershell Remove-Service -Name {SERVICE NAME} ```  ## Proxy server and load balancer scenarios  Services that interact with requests from the Internet or a corporate network and are behind a proxy or load balancer might require additional configuration. For more information, see <xref:host-and-deploy/proxy-load-balancer>.  ## Configure endpoints  By default, ASP.NET Core binds to `http://localhost:0000`. Configure the URL and port by setting the `ASPNETCORE_URLS` environment variable.  For additional URL and port configuration approaches, see the relevant server article:  * <xref:fundamentals/servers/kestrel#endpoint-configuration> * <xref:fundamentals/servers/httpsys#configure-windows-server>  The preceding guidance covers support for HTTPS endpoints. For example, configure the app for HTTPS when authentication is used with a Windows Service.  > [!NOTE] > Use of the ASP.NET Core HTTPS development certificate to secure a service endpoint isn't supported.  ## Current directory and content root  The current working directory returned by calling <xref:System.IO.Directory.GetCurrentDirectory*> for a Windows Service is the *C:\\WINDOWS\\system00* folder. The *system00* folder isn't a suitable location to store a service's files (for example, settings files). Use one of the following approaches to maintain and access a service's assets and settings files.  ### 