Posts

Simple Network Management Protocol (SNMP) is missing from Windows 10 Windows Features in Control Panel

Image
You may find that Simple Network Management Protocol (SNMP) is missing from Windows 10 Windows Features in Control Panel. This is a deprecated feature now however you may still have need of it.  To install this in current versions of Windows 10 goto the modern Settings UI and Add an optional feature Click Add a feature and search for SNMP

Microsoft Visual Studio designer cannot open and reports the error "The designer could not be shown for this file because none of the classes within it can be designed."

I had a problem today whereby I couldn't open the Visual Studio form designer and received the following error viewing any form or user control. The designer could not be shown for this file because none of the classes within it can be designed.  at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)  The solution was to rename the  ProjectAssemblies directory in the appropriate Visual Studio directory and reopen the project. It seems there was some kind o...

Rendering ASP.NET C# CompositeControls and web controls with a tag such as a DIV instead of a SPAN tag.

I've recently had a problem with an ASP.NET composite control where I'd added some specific styles directly to the control. Weirdly .NET (4.6.2 in this case) would take the styles from the SPAN tag of the CompositeControl and apply them to the panels that these custom controls were in. Very strange. The simplest solution is to change the SPAN tag emitted by the CompositeControl to a DIV tag. This can be done by overriding the TagKey property. /// <summary> /// Gets the tag key for the control. /// </summary> protected override HtmlTextWriterTag TagKey {      get { return HtmlTextWriterTag.Div; } }

The Set-AzureADUserThumbnailPhoto PowerShell cmdlet ImageByteArray"

When you try and set an Azure Active Directory user thumbnail using the ImageByteArray parameter the command fails and you see the following error System.Management.Automation.CmdletInvocationException:   ---> System.ArgumentException:      at Microsoft.Open.Azure.AD.CommonLibrary.Utilities.ImageUtils.GetImage(Stream fileStream, String filePath, Byte[] imageByteArray) in X:\bt\1205398\repo\src\dev\PowerShell.V2\CommonLibrary\Utilities\ImageUtils.cs:line 114 This appears to be a bug in the internal code of the PowerShell cmdlets. To work around this in C# you need to convert your byte[] array to a memory stream, and use the FileStream parameter. This should work as expected. /// <summary> /// Sets the thumbnail photo for the specified acccount. /// </summary> /// <param name=" identifier "> The user principal name or object identifier of the user for which the thumbnail photo value should be set. </param> /// <par...

Getting the WinForms HelpProvider namespace for a control programatically using C#

We recently had an issue whereby we wanted to have a Windows Form control in a control library which could be presented with a HelpNamespace and HelpKeyword that could be customised based on the end product that the UI was integrated with. The control itself automatically inherits the help of the parent, but when the control opens a child form that Windows Form doesn't know of the help information. However, manually assigning the HelpNamespace to the UI control which it then passes to the form seemed tedious given that the form on which the control resides already knows the namespace, but how to get that namespace programatically. The HelpProvider is a component, not a control so you need to use the following code. If the control doesn't have a HelpProvider assigned directly, the controls' parent is queried. /// <summary> /// Returns the help namespace assigned to the specified control, or its parent form. /// </summary> /// <param name=" control ...

Going to Barbados for in 2020/2021 and the coronavirus COVID-19 crisis

Image
If you're in Britain and looking to escape winter, COVID, and BREXIT the Barbados government is looking get you in and get you spending.  Here's my experience and honest feedback of the island. Barbados got onto the UK FCO exception list of countries it's safe to go to, if the country isn't on the list your insurance probably won't be valid. You really need insurance. I found StaySure  was pretty sensible, we paid for cover for a couple of days before, and several weeks after we're due to return to be safe. BE WARNED:  Some travel insurance won't cover you at all if you don't have a return flight booked when you leave.   Barbados is a small island and all but stamped out Coronavirus  and is using a membrane plan to not let new infections in Barbados put countries into categories based on their risk. The UK is HIGH risk . High risk countries need to get a PCR test before coming here and a fit to fly certificate. You have to pay private as the NHS won...

How to open multiple copies of Regedit.exe at the same time to compare registry keys.

Image
If you want to open multiple copies of Regedit.exe at the same time - for example if you want to compare two regions of the registry you can do this with the command regedit.exe /m regedit.exe -m