Recently i needed to generate early bound class for my dynamics crm 365 online and i faced a weird issue.
I had my SDK which i have been using so i opened the command prompt and tried below commands :
1. CrmSvcUtil.exe /url:https://passiond.api.crm8.dynamics.com/XRMServices/2011/Organization.svc /out:C:\Users\rawish.kumar\Desktop\EarlyBound.cs /username:"rawish.kumar@passiond.onmicrosoft.com" /password:"password" /namespace:earlybound /serviceContextName:ServiceContext
2. CrmSvcUtil.exe /url:https://passiond.api.crm8.dynamics.com/XRMServices/2011/Organization.svc /out:GeneratedCode.cs /username:"rawish.kumar@passiond.onmicrosoft.com" /password:"password"
However it wasn’t working and i was getting below error :
Unable to login to Dynamic CRM
Resolution:
- first i tried to modify the command by NOT providing username and password & simply putting /il in the end :
CrmSvcUtil.exe /url:https://passiond.api.crm8.dynamics.com/XRMServices/2011/Organization.svc /out:GeneratedCode.cs /il
what it does is – it gives you a popup from XRMTooling to enter username password manually.
- I downloaded the latest version of CrmSvcUtil from Nuget by using powershell.
to do this – open powershell as an admin and enter the below command first + Enter:$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" $targetNugetExe = ".\nuget.exe" Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe Set-Alias nuget $targetNugetExe -Scope Global -VerboseAnd then below + Enter:./nuget install Microsoft.CrmSdk.CoreTools -O .\Tools md .\Tools\CoreTools $coreToolsFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.CoreTools.'} move .\Tools\$coreToolsFolder\content\bin\coretools\*.* .\Tools\CoreTools Remove-Item .\Tools\$coreToolsFolder -Force-Recurse
- It will download the latest version of this tool for you which you can find under C:\Users\rawish.kumar\.nuget\packages\Microsoft.CrmSdk.CoreTools\9.0.0.7\content\bin\coretools
- Now what you have to do is replace the with above i command prompt:
just type in cd followed by the path C:\Users\rawish.kumar\.nuget\packages\Microsoft.CrmSdk.CoreTools\9.0.0.7\content\bin\coretools
- Now put the main command which we prepared and hit enter:
CrmSvcUtil.exe /url:https://passiond.api.crm8.dynamics.com/XRMServices/2011/Organization.svc /out:GeneratedCode.cs/il
- it will give you a popup to login:
- Once its done – it will take some time and download the code:
- the file will be generated in the same folder.
I hope this helps!