WEBSITE_SWAP_WARMUP_PING_PATH: /statuscheck WEBSITE_SWAP_WARMUP_PING_STATUSES: 200
WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG: 1 //prevent random cold starts
This is an example for ASP.NET Core
// create a DateTime in UTC Time | |
DateTime _startDate = TimeZoneInfo.ConvertTimeToUtc(Convert.ToDateTime("3/12/2023 20:00:00"), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")); | |
// Use UTC Now to compare UTC datetimes | |
DateTime _now = DateTime.UtcNow; | |
bool nowIsBefore = _now < _startDate; | |
bool nowIsEqual = _now == _startDate; |
using System; | |
using System.Text.Json.Serialization; | |
using System.Threading.Tasks; | |
using System.Linq; | |
using RestSharp; | |
public class MarketingCloudApi |
$(".datePicker").flatpickr({ | |
enableTime: true, | |
altInput: true, | |
altFormat: "n-j-Y h:i K" | |
}); |
WEBSITE_SWAP_WARMUP_PING_PATH: /statuscheck WEBSITE_SWAP_WARMUP_PING_STATUSES: 200
WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG: 1 //prevent random cold starts
This is an example for ASP.NET Core
@page | |
@model Demo.Pages.Users.UpdateUserPasswordModel | |
@{ | |
} | |
<section class="section"> | |
<div class="container"> | |
<h1 class="is-headline">Update User Password</h1> | |
<form method="post"> |
<UserSettings> | |
<ApplicationIdentity version="16.0"/> | |
<ToolsOptions> | |
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"> | |
<ToolsOptionsSubCategory name="Import and Export Settings" RegisteredName="Import and Export Settings" PackageName="Visual Studio Environment Package"> | |
<PropertyValue name="TrackTeamSettings">false</PropertyValue> | |
<PropertyValue name="TeamSettingsFile"/> | |
<PropertyValue name="AutoSaveFile">%vsspv_vs_localappdata_dir%\settings\CurrentSettings.vssettings</PropertyValue> | |
</ToolsOptionsSubCategory> | |
<ToolsOptionsSubCategory name="ProductUpdates" RegisteredName="ProductUpdates" PackageName="VS Setup Composition"> |
When Running a web app in Visual Studio errors in Could not find a part of the path '[path]\roslyn\csc.exe'. | |
Run this command in Package Manager Console: | |
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
// add this somewhere in your configure method | |
app.UseRewriter(new RewriteOptions() | |
.Add(new SubdomainRedirectRule()) | |
.AddRedirectToWwwPermanent() | |
); | |
} |
using System.Linq; | |
using System.Security.Principal; | |
public static class AuthorizationExtensions | |
{ | |
public static bool IsInAllRoles(this IPrincipal principal, string[] roles) | |
{ | |
return roles.All(r => principal.IsInRole(r)); | |
} |
using Microsoft.AspNetCore; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using System.Threading.Tasks; | |
using MyApp.Data; | |
namespace MyApp | |
{ | |
public class Program |