Posts

Determine what version of Java is installed on Windows machines on your network

Image
You can use XIA Configuration Server to determine what version of Java is installed on Windows machines on your network. The version of Java can be seen in control panel: This information can be queried easily using XIA Configuration Server , simply Go to Browse Reports and select Windows Machine Reports > Software Reports > Software Installation Summary Report Enter Oracle Corporation as the Publisher Enter %Java% as the Name Click the Execute button

Icons corrupt, lose resolution, or quality in Winforms (Windows Forms) ListViews and TreeViews when using the ImageList control.

Image
WinForms is still alive and well, perhaps not too well given the number of issues that crop up in these rather old controls. Whilst most user interface work is now carried out on a web platform you may still have applications written in Windows Forms for the .NET Framework. One issue we've recently encountered was with the ListView and TreeView controls displaying icons in a substandard fashion either corrupting the icons or generally lowering the quality. Whilst this can be seen in the ListView or TreeView controls the issue is actually with the ImageList control which can lower the quality of images when serializing them. Zooming in to a corrupted image and the exact same image that hasn't been corrupted by the image list the difference is clear. The workaround to the issue is to store the images in a resource file You can then load the images into the image list from the resource file dynamically when the form is loaded so that the ImageList never has to serialize them. You ...

C# .NET Remoting shows error System.Security.SecurityException. Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.

When using .NET Remoting you may see the following error: System.Security.SecurityException.  Type System.DelegateSerializationHolder and the types derived from it (such  as System.DelegateSerializationHolder) are not permitted to be deserialized  at this security level.  System.Runtime.Serialization.SerializationException A lot of comments on the Internet point to the following to change your security level. https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.typefilterlevel?view=netcore-3.1 However if this is the first time that you've seen this error it maybe because you've introduced something inadvertantly that breaches the security requirements of the default low security level and it would be safer to remove that issue instead of reducing your security. For me I found that we'd implemented the INotifyPropertyChanged interface on a class. This defines the PropertyChanged event, and this then breaks your security model. /// ...

C#.NET Suppress Trace Messages From Specific "noisy" DLL

We've recently had a problem with the .NET diagnostics trace listeners. These allow you to easily write diagnostics information to, for example, a text file. However these are static methods so when you use 3rd party DLLs you may find that your nice simple trace messages suddently become "hijacked" by a "noisy" DLL. It's very hard to separate the source of the Trace.WriteLine() call without pulling up stack traces which can impact performace. Here's a simple workaround where you can use the category to exclude messages from elsewhere. Create a method which calls Trace.WriteLine() for you which passes a GUID so you know it has been called from your class. /// <summary> /// Provides the ability to log diagnostics information to the system trace log. /// </summary> public class DiagnosticsSupport {     /// <summary>     /// Writes the specified message to the diagnostics trace log.          /// <...