Cloud Insight Telegraf agent fails to install with error "CS0246: The type or namespace name 'ICertificatePolicy' could not be found"
Applies to
- Cloud Insights
- Telegraf agent for Windows
Issue
When trying to install the Telegraf agent the install fails right away with the following error:
Add-Type: C:\Users\user1\cloudinsights-windows-env.ps1:1 Line | 1 | Add-Type 'using System.Net; using System.Security.Cryptography.X509Ce … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | (1,107): error CS0246: The type or namespace name 'ICertificatePolicy' could not be found (are you | missing a using directive or an assembly reference?) using System.Net; using | System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { | public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest | request, int certificateProblem) {return true;}} | ^