Closed macieja1984 closed 6 years ago
We are running fine on 9.1.0.33, could you check which version your CRM SDK dlls are? Both the project as well as the one that XDT includes.
I've installed newest updates for XDT and for all Crm.SDKs rom nuget. The versions on F# project are And those are the ones from nuget in my regular project:
Error still exists. What are the dll versions that I should be using?
The dll version should be 9.+, which you are using. So that is not the issue.
I think the issue stem from CRM requiring TLS1.2 protocol. It can be that either PowerShell og FSharp that uses TSL11 or later. Try to execute the following line in powershell before you call XDT to force it to use TLS1.2 in the current session.
[Net.ServicePointManager]::SecurityProtocol.Tls12
If that does not work, then see if you can upgrade you FSharp to a later version. I think we had a problem with FSharp 4.0.
Also, I have just tested it against 9.1.0.35 and I am personally not experiencing any problems. I am currently using FSharp 4.5
That is really weird. My instance is on exactly same version. I've added the TLS1.2 protocol to both F# project and to powershell. It still does not help.
In powershell I used both your suggestion and:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
suggested by this site
I've update F# version and result is the same.
Can it be config fault? What is the minimum config I need to provide for XDT to work? What is even weirder that I can connect to ogranization using standard C# console using following code
var ConnectionString = "Url=https://INSTANCE-development.api.crm4.dynamics.com/XRMServices/2011/Organization.svc; Username=USER; Password=PASSWORD; authtype=Office365";
var conn = new CrmServiceClient(ConnectionString);
return (IOrganizationService)conn.OrganizationWebProxyClient != null
? conn.OrganizationWebProxyClient
: (IOrganizationService)conn.OrganizationServiceProxy;`
The minimum configuration for XDT are the following arguments which can be found at https://github.com/delegateas/XrmDefinitelyTyped/wiki/Tool-usage; url, username and password. Everything else is optional and has default values that you can overwrite. However, I would probably add the Authentication Provider Type as well with the value "OnlineFederation" for Dynamics 365 online just to be sure. I can't remember what the default value for that parameter is.
If this does not work, then maybe double check that you are able to login with that user normally. Just to be sure that it is not a expired password that causes the issue.
During debugging I could see that OnlineFederation was being chosen as provider in a switch CrmAuth.fs class, so I don't think this is the case.
Password is working, I'm able to log in with this user to CRM via browser and connect from C# console app. I will try to investigate more on Monday. I'll post whatever I find. Thank you for help.
The issue turned out to be incorrect password in config file. Sorry for the trouble.
After upgrade of our instance to v. 9.1.35 I cannot generate TypeScript models any more. When using powershell script following message is displayed
I've cloned the F# solution for debuging and the error occures in CrmAuth.fs:45.
StackTrace:
Server stack trace: at System.ServiceModel.Channels.SecurityChannelFactory
1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory
1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 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 System.ServiceModel.Security.IWSTrustContract.Issue(Message message) at System.ServiceModel.Security.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration
1.Issue(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration
1.AuthenticateInternal(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration1.AuthenticateTokenWithOrgIdForCrm(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration
1.AuthenticateOnlineFederationInternal(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration1.Authenticate(AuthenticationCredentials authenticationCredentials) at DG.XrmDefinitelyTyped.CrmAuth.authenticate(Uri org, AuthenticationProviderType ap, String username, String password, String domain) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\Crm\CrmAuth.fs:line 45 at DG.XrmDefinitelyTyped.CrmBaseHelper.proxyHelper(XrmAuthentication xrmAuth, Unit unitVar1) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\Crm\CrmBaseHelper.fs:line 215 at DG.XrmDefinitelyTyped.DataRetrieval.connectToCrm(XrmAuthentication xrmAuth) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\Generation\DataRetrieval.fs:line 17 at DG.XrmDefinitelyTyped.GenerationMain.retrieveRawState(XrmAuthentication xrmAuth, XdtRetrievalSettings rSettings) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\Generation\GenerationMain.fs:line 14 at DG.XrmDefinitelyTyped.XrmDefinitelyTyped.GenerateFromCrm(XrmAuthentication xrmAuth, XdtRetrievalSettings rSettings, XdtGenerationSettings gSettings) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\XrmDefinitelyTyped.fs:line 51 at DG.XrmDefinitelyTyped.XrmDefinitelyTyped.GenerateFromCrm(String url, String username, String password, FSharpOption
1 domain, FSharpOption1 ap, FSharpOption
1 outDir, FSharpOption1 jsLib, FSharpOption
1 tsLib, FSharpOption1 entities, FSharpOption
1 solutions, FSharpOption1 crmVersion, FSharpOption
1 useDeprecated, FSharpOption1 skipForms, FSharpOption
1 oneFile, FSharpOption1 restNs, FSharpOption
1 webNs, FSharpOption1 viewNs, FSharpOption
1 formIntersects, FSharpOption1 viewintersects, FSharpOption
1 generateMappings, FSharpOption`1 skipInactiveForms) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\XrmDefinitelyTyped.fs:line 42 at Program.main(String[] argv) in C:\Users\Dev\Source\Repos\delegateas\XrmDefinitelyTyped\src\XrmDefinitelyTyped\CommandLine\Program.fs:line 132