I'm trying to create a MapReduce job using HDInsight .NET SDK tutorial.
In creating the JobSubmissionCertificateCredential
object, specifically the following line:
X509Certificate2 cert = store.Certificates.Cast<X509Certificate2>().First(item => item.FriendlyName == certfriendlyname);
I'm getting the following error: 'System.Security.Cryptography.X509Certificates.X509Certificate2Collection' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'System.Security.Cryptography.X509Certificates.X509Certificate2Collection' could be found (are you missing a using directive or an assembly reference?)
I have...
using System.Security.Cryptography.X509Certificates;
at the top of my class.Install-Package Microsoft.WindowsAzure.Management.HDInsight
Anyone know of any updates to this block of code that gets the Cast
working? Thanks!
Cast<T>
is part of the Enumerable
type located in the System.Linq
namespace. Add a reference to that namespace and you'll be good.