Saturday, 8 May 2021

Windows 10 Upgrade caused inaccessible boot device

 Inserted Windows 10 USB

Used command prompt from this article

  • Bootrec /fixmbr
  • Bootrec /fixboot
  • Bootrec /rebuildbcd

 However the last command returns:

The requested system device cannot be found.

See if a disk is MBR or GPT

First. Determine wheteher you have GPT disks or MBR disks.

GPT work on the newer UEFI mode boot in BIOS, whereas MBR disks use legacy mode.

diskpart

list disk

See if it has a * in the GPT column


https://support.novastor.com/hc/en-us/articles/360011403653-How-to-repair-the-EFI-bootloader-on-a-GPT-HDD-for-Windows-7-8-8-1-and-10

These commands succeeded.

However on booting it now complained:

Your PC/Device needs to be repaired

File: \BCD

Error code: 0xc0000098

In the BIOS turned disabled CSM Support (this supports legacy [MBR] boots).

As I had GPT disks I had to be sure I was only trying to load in UEFI mode.

Restored the EFI bootloader using this
https://support.novastor.com/hc/en-us/articles/360011403653-How-to-repair-the-EFI-bootloader-on-a-GPT-HDD-for-Windows-7-8-8-1-and-10




Saturday, 1 May 2021

Panasonic camera

 To turn off the "IA" symbol being streamed on the HDMI out on the Panasonic camera, go to Setup > External Display and switch to "Off".

Thursday, 29 April 2021

Using the Azure App Gateway: networking

 I had an Azure App Gateway providing a routing gateway over a backend App Service and Wordpress site.

I found two problems:

1. Outbound calls from the Azure App Service to a Webservice on the internet failed intermittently.

In the end I discovered the App needed a NAT Gateway as it was suffering SNAT exhaustion. I also improved the code to recycle client connections.

2. Accessing the Wordpress URLs would start erroring with a 502. The backend health probe would occassional complain it couldn't connect, or timed out. Performing a connection diagnostic test (trying to connect on TCP/IP showed 4 errors in 66 attempts).

Again this was a SNAT exhaustion problem. The App Gateway was in a subnet, so I associated the NAT Gateway with that subnet.

Saturday, 9 January 2021

Trials of WCF clients and .NET Core 3.1

 I've spent four days debugging a simple WCF problem. We had a WCF server that we needed to connect to. That server required WSSE username/password security, as you can see from various excerpts in the WSDL:


    
        
            
                
            
        
    

And from a working client, I could see that a good SOAP message looked like this:


    
        
            
                2021-01-09T08:50:59.443Z
                2021-01-09T08:55:59.443Z
            
            
                MyUsername
                MyPassword
            
        
    
    
            My Body goes here
    
Initially I went on a whole route of writing code to create the necessary SOAP header.

A great article is described here:

The bugs I encountered where:

The header 'Security' from the namespace 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' was not understood by the recipient of this message, causing the message to not be processed.

In the end I discovered the simplest implementation was the correct one and no overrides were required. But a bug was still found.  I was getting the error:

The value 'TransportWithMessageCredential' is not supported in this context for the binding security property 'securityMode'.

The solution was found here:

c# - Why TransportWithMessageCredential is not supported in .net core? - Stack Overflow

Even though I created a new .NET Core 3.1 client, the default ServiceModel packages installed were version 4.4, and upgrading them to 4.8 allowed me to set BasicHttpsSecurityMode.TransportWithMessageCredential.


Final code

var endpointAddress = new EndpointAddress(uri);
var binding = new BasicHttpsBinding();
binding.Security.Mode = BasicHttpsSecurityMode.TransportWithMessageCredential;
var client = new StartSessionServiceClient(binding, endpointAddress);
client.ClientCredentials.UserName.UserName = "MyUsername";
client.ClientCredentials.UserName.Password = "MyPassword";
var response = await client.StartSessionAsync(new SessionStartArgs());


References

WCF WS-Security and WSE Nonce Authentication - Rick Strahl's Web Log (west-wind.com)



The value 'TransportWithMessageCredential' is not supported in this context for the binding security property 'securityMode'. - .NET Core 3.1

I had an .NET Core 3.1 WCF client trying to connect to a WCF service over HTTPS, passing a username and password using WSE Security.

Writing the client code:

var binding = new BasicHttpsBinding();
binding.Security.Mode = BasicHttpsSecurityMode.TransportWithMessageCredential;

I was getting the error:

The value 'TransportWithMessageCredential' is not supported in this context for the binding security property 'securityMode'.

This was because the default project installed System.Service model assemblies, version 4.4. Upgrading them to 4.7 or higher fixes this.

Monday, 4 January 2021

Surface Pro 4 monitor woes with a Dell 2515H

 Occassionally my monitor would show a very low resolution and I was unable to set it back to a high resolution as they were unavailable in Windows.

This article pointed me to this Dell article.

Changing the monitor configuration to DP Version 1.2 fixed the problem.

Saturday, 2 January 2021

Startup apps in Windows 10

https://www.msftnext.com/manage-windows-10-startup-apps/

1. Task Manager

2. Startup folder:

C:\Users\<User>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

or %appdata%\Microsoft\Windows\Start Menu\Programs\Startup

3. Registry

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

and

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

4. Store app startup

Settings - Apps - Startup

5. Task Scheduler