Server Error in '/' Application.

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Security.Cryptography.CryptographicException: Invalid provider type specified.

  at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
  at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
  at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
  at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
  at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
  at Google.Apis.Auth.OAuth2.ServiceAccountCredential.Initializer.FromCertificate(X509Certificate2 certificate) in C:\Apiary\v1.22\google-api-dotnet-client\Src\Support\GoogleApis.Auth.PlatformServices_Shared\OAuth2\ServiceAccountCredential.cs:line 106
  at Peyravi2.web.Common.GoogleHelper.GetFileById(String fileId, HttpServerUtility Server, GoogleSec sec) in C:\Files\Source Code\EDU.WebServices\Common\GoogleHelper.cs:line 27
  at EDU.WebServices.GoogleDrive.GetFileById(GoogleSec sec, String fileId) in C:\Files\Source Code\EDU.WebServices\GoogleDrive.asmx.cs:line 24
  --- End of inner exception stack trace ---

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ServiceModel.FaultException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Security.Cryptography.CryptographicException: Invalid provider type specified.

  at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
  at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
  at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
  at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
  at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
  at Google.Apis.Auth.OAuth2.ServiceAccountCredential.Initializer.FromCertificate(X509Certificate2 certificate) in C:\Apiary\v1.22\google-api-dotnet-client\Src\Support\GoogleApis.Auth.PlatformServices_Shared\OAuth2\ServiceAccountCredential.cs:line 106
  at Peyravi2.web.Common.GoogleHelper.GetFileById(String fileId, HttpServerUtility Server, GoogleSec sec) in C:\Files\Source Code\EDU.WebServices\Common\GoogleHelper.cs:line 27
  at EDU.WebServices.GoogleDrive.GetFileById(GoogleSec sec, String fileId) in C:\Files\Source Code\EDU.WebServices\GoogleDrive.asmx.cs:line 24
  --- End of inner exception stack trace ---

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FaultException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Security.Cryptography.CryptographicException: Invalid provider type specified.

   at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
   at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
   at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
   at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
   at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
   at Google.Apis.Auth.OAuth2.ServiceAccountCredential.Initializer.FromCertificate(X509Certificate2 certificate) in C:\Apiary\v1.22\google-api-dotnet-client\Src\Support\GoogleApis.Auth.PlatformServices_Shared\OAuth2\ServiceAccountCredential.cs:line 106
   at Peyravi2.web.Common.GoogleHelper.GetFileById(String fileId, HttpServerUtility Server, GoogleSec sec) in C:\Files\Source Code\EDU.WebServices\Common\GoogleHelper.cs:line 27
   at EDU.WebServices.GoogleDrive.GetFileById(GoogleSec sec, String fileId) in C:\Files\Source Code\EDU.WebServices\GoogleDrive.asmx.cs:line 24
   --- End of inner exception stack trace ---]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14764695
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +403
   Peyravi2.web.EDU.GoogleDriveSoap.GetFileById(GetFileByIdRequest request) +0
   Peyravi2.web.EDU.GoogleDriveSoapClient.Peyravi2.web.EDU.GoogleDriveSoap.GetFileById(GetFileByIdRequest request) +93
   Peyravi2.web.EDU.GoogleDriveSoapClient.GetFileById(GoogleSec sec, String fileId) +207
   Peyravi2.web.Common.GoogleHelper.GetFileById(String fileId, HttpServerUtilityBase Server, DataModelContainer db) +207
   Peyravi2.web.Common.Data.GetPageByGoogle(Int32 pageType, String googleId, HttpServerUtilityBase server) +118
   Peyravi2.web.Controllers.HymnController.details(String code, String id) +3475
   lambda_method(Closure , ControllerBase , Object[] ) +191
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +69
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +396
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +69
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +59
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +32
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +73
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +59
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +46
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +59
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +431
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4676.0