Tuesday 2 January 2018

Dynamics CRM V9 connection Error in Pluging/Console or Custom Web Application/Report Viewer in VS

Recently faced a strange issue in CRM v9 while connecting to Org Service. It was perfectly working before last night. Issues faced  in different scenarios. Am trying to consolidate all here . If any one faces any of the below issue then try the solution given below.

ISSUES:
Not able to login Plugin registration tool (Keep popping up for Credentials)
Not able to see custom entites in Plugin Registration tool
Connection to CRM from Custom Web application & console failed
Can able to retrive data in DataSet in Report rdl but not able to Preview





























ROOT CAUSE:
Its all because of the latest update in the Microsoft TSL(Transport Security Layer) Protocol in SDK assemblies..Microsoft allowed the TSL connection 1.0  and 1.1 for the browsers or client to connect the CRM org.Now Microsoft will support only TSL 1.2 or above going forward(Reference) . If you are connecting your org with the old version of plugin registration tool , then you may face this issue.


HOW TO IDENTIFY:
Use fiddler to check the your server request TSL Version. Install fiddler https://www.telerik.com/download/fiddler



SOLUTION:
1.For Plugin Issue: Update latest SDK from the Plugin Registration Tool 
or Download tools from NuGet

2.For Report: Uninstall Report Authoring Extension and install the latest.(Make sure Installed dll is the latest SDK 9.0). if this doesnt resolve the issue then follow the below step.

On the machine where VS is installed go to the start menu, then type run and then enter. Type in regedit and then OK.

Once the Registry Editor is open, go to: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319
Right click on the name of the folder (the v4.0.30319 folder) and select New, then DWORD. Give it the name of SchUseStrongCrypto and the Value of 1. Exit the Registry Editor, then restart your machine. 

3.For Custom Application or Console App : Include the below reference to your project(to global config file the line before where your client credentials is configured) and change the .Net framework to 4.6.1 and rebuild 
"ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12"



If you can't update you project to the latest assembly version (4.6) then follow the step give by Mr.Massoud in the comment.

IMPORTANT:
4. Modify using TSL to 1.2 through Fiddler . Keep open the fiddler after modifying and try to connect if you dnt have latest SDK or if you were not able to connect with the above methods.

FOR END USERS:
Please upgrade all your browsers(IE,Chrome,Firefox,Safari) which supports TSL 1.2 and  can send the secure request to all your client applications

77 comments:

  1. Great article Syed. Following this at least my plugin registration tool is working now.

    ReplyDelete
  2. Thanks for your post. This resolved the issue I was having with the plug-in registration wizard. For the report authoring extension, I downloaded what appears to be the latest version. On Microsoft's download site it says it's version 8.2.2.248 but once installed it says it's version 8.2.0002.0248. I'm still having the same issue you describe in your post. You also mentioned, "(Make sure Installed dll has the latest SDK)". Could you elaborate on that?

    ReplyDelete
    Replies
    1. hi Warren,
      When you install the Report authoring extention it will contains the Xrm.tooling to connect to CRM org to fetch record to your report viewer.So try to uninstall your extn and download the latest extn if that doesnt work, just download latest SDK core dll using NuGet and replace in the follow files location(where your etxn is installed . Like (C:\Program Files\)

      \\CRM Report Authoring Extention\Report Authoring Extn\PFiles\MSCRM\BidsExtensions

      Delete
    2. I still can't get this to work. I've added the latest Microsoft.Xrm.Sdk.dll to the BidsExtension folder and then installed BIDS but it still won't connect in VS. Any other suggestions?

      Delete
  3. Banging my head all over, finally found your great article. Downloaded tools from Nuget link you provided, now Configuration Migration tool is working. Thanks bro.

    ReplyDelete
  4. Welcome Srinaath. glad to know it is helpful for you

    ReplyDelete
  5. Hi Syed
    I am facing issue with Reporting. Is there any reference link to download report authentication extension for Dynamics 365 version 9.0

    ReplyDelete
  6. share your mail id i will share the exe which i have.

    ReplyDelete
    Replies
    1. Hi Syed, It was really helpful for Plugin registration Tool. But I am unable to resolve it for Report Authoring extension. Could you please send me a link to download latest Report Authoring Extension for Dynamics 365 V9. My email ID is atul.bhagat@accenture.com

      Delete
    2. this is my email jamil.lamyae@gmail.com can you share the last version you have with me please

      Delete
    3. Hi Syed, I think this article is exactly what I am looking for. Can you send the version you have to me? Would be very grateful. Meganvwalker@gmail.com

      Delete
    4. Hi Syed. Thank you for this article. It was very helpful to me to resolve the plugin registration tool issue. But following the steps you have mentioned, I couldn't solve the SSRS Report Authoring Extension problem. Here is my email: amine.kolsi@outlook.com So if you can please sendig me the latest version of Report Authonring Extension you get. Thank you!

      Delete
    5. I wasn't ever sent the extension and needed to get it resolved so contacted Microsoft. This is the resolution that worked for me:

      On the machine where VS is installed go to the start menu, then type run and then enter. Type in regedit and then OK.

      Once the Registry Editor is open, go to: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319
      Right click on the name of the folder (the v4.0.30319 folder) and select New, then DWORD. Give it the name of SchUseStrongCrypto and the Value of 1. Exit the Registry Editor, then restart your machine.

      Hope that helps!

      Delete
    6. Hi sir, can you send me the ext too ? :) thanks. rjjoseph.espiridion@gmail.com

      Delete
    7. Thankyou Megan,
      Your solution helped. I didn't need to update my plugin or sdk.
      This actually worked.

      Delete
    8. Hi Syed,
      Could you please share the latest version of Report Authoring Extension to my email id: roxannaappleby@hotmail.com ?
      Also, I followed your instructions to fix the plugin registration tool, but it still won't work for me. Do you have any other suggestions or insights if you can will be very helpful. Thanks a ton for the detailed article.

      Delete
  7. Hi Syed. Please share the reference link to download report authentication extension for Dynamics 365 version 9.0.

    ReplyDelete
  8. Hi Syed, Thank you for the information. It put us in the right direction to find out how to fix this given we could not change the source code (i.e.not able to add SecurityProtocil nor change .NET Framework to 4.6). We did this by adding the following line to the the app.config of our app (had to remove greate-than and less-than chars to be able to publish):

    runtime
    AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false"\
    /runtime

    ReplyDelete
    Replies
    1. good info Massoud.If you can provide this code with tag where to park under config section ,then i will add this info also in the article . It may be beneficial to the community.

      Delete
    2. The app.exe.config technique does not work for ASP.NET apps so we had to find another way.
      Finally what works across the whole server is to create a new Key and REG_SZ entry in Registry here:

      HKLM\SOFTWARE\Microsoft.NETFramework\AppContext

      Name: Switch.System.Net.DontEnableSchUseStrongCrypto
      Data: false

      Restart IIS

      Delete
  9. In the app.config file add this:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <runtime>
    <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false"/>
    </runtime>
    </configuration>

    ReplyDelete
    Replies
    1. thanks massoud. will update the article with the info provided

      Delete
  10. Thanks Syed for research, this is a real help to the community, this fix was the need of the hour...Trying this fix now.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. hello i tried your suggestion on solving the reporting issue my sdk is 9 but the latest bids in microsoft website is version 8 please can you help slve the problem

    ReplyDelete
  13. Hi i still have the same issue fo report my sdk is 9 too and the last version od bids is 8 help please

    ReplyDelete
    Replies
    1. Try to replace the latest dll in the Report Authoring Extn installed bin folder and restart your VS.hope this works or keep the Fiddler open while working on report in VS

      Delete
    2. i still got the same erreur step i did :
      i got the last version of report authoring Extn
      in C:\Program Files (x86)\PFiles\MSCRM\BidsExtensions I CHANGE DLL SDK WE THE LAST VERSION
      I CHANGE THE TLS IN FIDDLER TO TLS 1.2 and keep it open
      log file :
      Source : Not Provided
      Method : Not Provided
      Date : 26/12/2017
      Time : 17:32:56
      Error : The authentication type must be specified.
      Nom du paramètre : CrmPassword
      Stack Trace : Not Provided
      ======================================================================================================================

      Source : mscorlib
      Method : ThrowIfExceptional
      Date : 19/01/2018
      Time : 14:18:13
      Error : Une ou plusieurs erreurs se sont produites.
      Stack Trace : à System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
      à System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
      à System.Threading.Tasks.Task`1.get_Result()
      à Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ExecuteAuthenticateServiceProcess(Uri serviceUrl, ClientCredentials clientCredentials, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean isOnPrem, String authority, Uri& targetServiceUrl, AuthenticationContext& authContext, String& resource)
      à Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverOrganizations(Uri discoveryServiceUri, ClientCredentials clientCredentials, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean isOnPrem, String authority)
      à Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.QueryOAuthDiscoveryServer(Uri discoServer, ClientCredentials liveCreds, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath)
      à Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.FindCrmOnlineDiscoveryServer(ClientCredentials liveCreds)
      à Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.ValidateServerConnection(CrmOrgByServer selectedOrg)
      ======================================================================================================================

      Delete
    3. hi Syed I create a ticket on microsoft community could you please take a look on it https://community.dynamics.com/crm/f/117/t/265496

      Delete
  14. Hi,
    Could you send me the last version of " Microsoft.Xrm.Sdk.dll " please ?

    My email is : Kenny.rodne@gmail.com

    Thanks a lot

    ReplyDelete
  15. For Reporting, this issue was resolved by doing the following:

    On the machine where VS is installed go to the start menu, then type run and then enter. Type in regedit and then OK.

    Once the Registry Editor is open, go to: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319
    Right click on the name of the folder (the v4.0.30319 folder) and select New, then DWORD. Give it the name of SchUseStrongCrypto and the Value of 1. Exit the Registry Editor, then restart your machine.

    Hope that helps!

    ReplyDelete
    Replies
    1. Hi Megan, I am not getting the folder .NETFramework under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft

      I have .Net Framework installed.

      Am I missing any software installation here.

      I created the folder by myself and provided the DWORK Key still report is not working in VS and it keep asking the credentials.

      I am able to run the report by running fidler, just curious to know it we can work without fidler.

      Delete
  16. Hi Syed

    I have an issue when I login to plugin registration tool (latest one which I downloaded from visual studio). Version of PRT is 9.0.0.9154 64bit. Could you help me please?

    Thanks
    AB

    ReplyDelete
    Replies
    1. What error are you getting? Can you pls share it . Are you trying to connect v9 instance? Send me your mail id so as i can drop send you the latest which i have.

      Delete
  17. Where do I get the Version 9.0 DLL's for CRM Reporting BIDS Extension ? so that I can connect my Report to CRM.

    ReplyDelete
    Replies
    1. This is the crux of the problem. If you create a "point and click" report in Dynamics 365 version 9, it references version 9.0.0.0 of the Microsoft.Crm.Reporting.RdlHelper. The only problem is that the latest version of the reprot authoring extension references version 8.0.0.0 of the Microsoft.Crm.Reporting.RdlHelper.

      I have logged a ticket with Microsoft support, but a response to that could take some time

      Delete
    2. Hi,

      Did you able to resolve this issue for version 9.0.0.0 of microsoft.crm.reporting.rdlhelper.dll.

      Delete
  18. Hi Syed

    I have an issue when I login to plugin registration tool (latest one which I downloaded from visual studio). Version of PRT is 9.0.0.9154 64bit. Could you help me please?

    My email is arjunbabu87@gmail.com. Could you mail me please? I will share the issue details.

    Thanks
    AB

    ReplyDelete
  19. Hi Syed,

    I am not able to use VS2013 for creating SSRS. Need your help bro :(.
    Please share the files with me also in mdnazirahmed007@gmail.com

    ReplyDelete
  20. Hi Syed, can you send me the ext too ? :) thanks. jerssonbe@gmail.com

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. please help to share 9.0 SDk dll for plugin issue to kiran.ponguru@gmail.com
      i am unable to download it

      Delete
  22. Syed - Do you know of a fix concerning the XrmToolBox? I made the registry change but no success. Thank you, Gary

    ReplyDelete
  23. Hi Syed,

    Thanks for useful article,

    it would be a great help if you share 9.0 sdk on sahilmca4u@gmail.com

    ReplyDelete
  24. Hi Syed,can you send me the exe too ? download report authentication extension for Dynamics 365 version 9.0
    thanks. mayur.test2502@gmail.com

    ReplyDelete
  25. Hi , Uninstall BIDS and install the latest version of BIDS(v9), it will resolve the issue.

    https://www.microsoft.com/en-us/download/details.aspx?id=56973

    Dynamics 365, version 9.0 Report Authoring Extension (with SQL Server Data Tools support)

    ReplyDelete
  26. Had to set up a new machine, got installed the latest authoring extensions - looks like they are still "old".. had to use SchUseStrongCrypto parameter. Thanks Megan / Syed.

    ReplyDelete
  27. Hi Sayad,

    Basavaraj here, I am not able to give name and value in Registry Editor. I am getting error like "Cannot create a value, Error writing to a registory"

    Please help me , how to give the name , ? is there any shell script to do so.

    Thanks in advance.

    ReplyDelete
  28. Nice! you are sharing such helpful and easy to understandable blog. i have no words for say i just say thanks because it is helpful for me.



    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery







    ReplyDelete
  29. Download Synthesia for Windows PC from FileHorse. 100% Safe and Secure ✓ Free Download (32-bit/64-bit) Latest Version 2022. Synthesia Unlock Key

    ReplyDelete