Posts

Using .NET OpenAPI tool to auto-generate client code

 https://markheath.net/post/openapi-autogen-aspnetcore Note: please user Browse button to select OpenAPIs\swagger.json when adding OpenAPI

Push Existing Static Website Code to DevOps Using Visual Studio Code, and Publish to Azure from DevOps

Push Existing Static Website Code to DevOps Using Visual Studio Code Note: This can't be done via Visual Studio as Visual Studio doesn't have any project template for static web site (contain html, JavaScript, css, images etc only , no any .NET related code) Step 1: Create a local folder c:\dev\wan\Peace Fountain as the .Git repository Step 2: In DevOps      2.1 Create a project named Peace Fountain     2.3 Click "Clone in VS Code", select c:\dev\wan\Peace Fountain as repository location.            Note: This will create a  Peace Fountain sub folder under c:\dev\wan\Peace Fountain. We can see the auto-created .git under folder C:\dev\wan\Peace Fountain\Peace Fountain.      2.4 Copy all existing static web site code to C:\dev\wan\Peace Fountain\Peace Fountain Step 3: In Visual Studio Code     3.1 Commit All     3.2 When you click Synchronize Change button (the bottom line), you may see error:...

Visual Studio 2019: Switch an existing project from TFS to Azure DevOps

Steo 1: Create the empty projetc on  Azure DevOps Step 2:   Open existing project, Click Solution/File/Source Control/Advanced/Remove Map, Advanced/Change Source Control/Unbind all Step 3: Team Explorer/Manage Connections/Connect to project Step 4: Right click the Solution, Create Git repository/Other: Existing remote/Paste the URL of the remote repository/Create and push

"Your connection to this site is not private" in SharePoint 2016

This happened only when access from localhost. SharePoint 2016 Management Shell New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword Credit to:   https://www.enjoysharepoint.com/your-connection-to-this-site-is-not-private-sharepoint-2016/

Common WCAG / AODA Web Accessibility issues and Quick Fixes

Web Accessibility Evaluation Tool:  https://webaim.org/services/evaluation Empty link Before:  <a href="#"><span class="fa fa-search"></span></a> After:   <a href="#" aria-label (or title) ="Search"><span class="fa fa-search" aria-hidden="true"></span></a> Missing form label Before:                                                         <input type="text" class="form-control" placeholder="Search for..." id="searchQuery"> After: <label class="control-label sr-only" for="searchQuery">Search for...</label> <input type="text" class="form-control" placeholder="Search for..." id="searchQuery">

Visual Studio 2019: SharePoint 2010 Visual Webpart issue

Now days I have to use the modern Visual Studio 2019 to update the old SharePoint 2010 web site to meet the AODA accessibility standard.  Issue 1: ScriptManager and UpdatePanel not found in namespace System.Web.UI Solution:  Firstly locate the project where <asp:ScriptManager> is used. Usually it's used in the master page (in the branding project). Then add a reference to the assembly  System.Web.Extensions . Select Project-> Add Reference and then select the assembly name.  https://stackoverflow.com/questions/19122286/scriptmanager-and-updatepanel-not-found-in-namespace-system-web-ui Issue 2 The auto-generated webart.ascx.g.cs is missing 1. The “Site URL” property of your project The “Site URL” property of your project should be correct. 2. Click on the *.ascx and see its property The “Custom Tool” property should be set to “SharePointWebPartCodeGenerator” value. Configure properties, save *.ascx, make any temporary changes to *.ascx file, save again and PU...

SameSite Cookies

 https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/ https://www.thinktecture.com/en/identity/samesite/prepare-your-identityserver/ https://brockallen.com/2019/01/11/same-site-cookies-asp-net-core-and-external-authentication-providers/ For debugging purpose Go to chrome://flags and disable #same-site-by-default-cookies. If needed, also disable #cookies-without-same-site-must-be-secure . Restart Chrome for the changes to take effect. https://support.google.com/chrome/thread/34237768?hl=en