Illustrates dependency load exception when AI TelemetryClient.StartOperation method is called from a .NET 4.7.2 Windows Service.
MS Visual Studio Intaller Project adds incorrect assemblies to the installer package.
The type initializer for 'PerTypeValues1' threw an exception.
System.BadImageFormatException: Could not load file or assembly System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a or one of its dependencies.
Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
https://github.com/microsoft/ApplicationInsights-Home/issues/429
Add the 4 following assemblies manually from project bin folder to the Application Folder in addition to default "Project Output" in installer project:
- System.Buffers
- System.Memory
- System.Numeric.Vectors
- System.Runtime.CompilerServices.Unsafe