Exception occurred on the metadata service on client or server. See exception details below: >Failed to log on to Microsoft Dynamics

Hi All,

While refreshing, build or deploy in visual studio below error is coming:

Exception occurred on the metadata service on client or server. See exception details below:

Failed to log on to Microsoft Dynamics

In Event Log:

Unable to get version information using existing WCF configuration from local storage.

Exception details:
Microsoft.Dynamics.AX.Framework.Services.Client.MetadataServiceException: Exception occurred on the metadata service on client or server. See exception details below:

Unable to log on to Microsoft Dynamics AX. —> System.ServiceModel.FaultException: Unable to log on to Microsoft Dynamics AX.

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object ins, Object outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Dynamics.AX.Framework.Services.Metadata.Service.IAxMetadataService.GetServicesVersionInformation(Guid versionId)
at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataServiceClient.<>c__DisplayClasscf.b__cc(IAxMetadataService channel)
at Microsoft.Dynamics.AX.Framework.Services.Client.ServiceClientHelper.InvokeChannelOperation[TResult,TChannel](IServiceClient1 client, Func2 operationInvoker, Func2 exceptionWrapper) --- End of inner exception stack trace --- at Microsoft.Dynamics.AX.Framework.Services.Client.ServiceClientHelper.InvokeChannelOperation[TResult,TChannel](IServiceClient1 client, Func2 operationInvoker, Func2 exceptionWrapper)
at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataServiceClient.GetServicesVersionInformation(Guid versionId)
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationBootstrap.GetServicesVersionInformation(IClientConfiguration serviceClientConfiguration, Guid versionId)
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationInternal.GetClientConfiguration()

Please refresh the WCF configuration (using the client configuration utility).