none
Integrating Dynamics CRM 365 online with Word add-in VSTO RRS feed

  • Question

  • I'm developing a solution using VS 2017 with Word VSTO add-in project.

    The project is connecting to Dynamics CRM 365 online using SDK.

    When authenticating to Dynamics, it got error/exception. The code is working in Windows Form and Console application.

    Any ideas?


    Benjamin Fallar III

    Monday, July 1, 2019 5:22 AM

All replies

  • Hi,

    Since this issue is more related to VSTO , I'm moving it to a VSTO forum: 

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=vsto&filter=alllanguages

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thank you for your understanding.

    Regards,

    Bella Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to shareexplore and talk to experts about Microsoft Office 2019. 

    Tuesday, July 2, 2019 4:40 AM
  • Hello Benjamin,

    What error do you get? What code do you have now?

    The code is working in Windows Form and Console application.

    You can treat your VSTO based solution as a regular .net application. There are no any restrictions related to calling web services. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, July 3, 2019 4:37 PM
  • Yes, I treat my VSTO code similar to a standard .NET application, that's why I mentioned using a console application,the same code is working, but when it executed inside the add-in, it got error (connection refused). So I was wondering if there is any additional setup/configuration required when accessing Dynamics CRM 365 online from VSTO add-in.

    Benjamin Fallar III

    Thursday, July 4, 2019 2:24 PM
  • Benjamin,

    Which error/exception do you get in the code?


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, July 4, 2019 4:29 PM
  • Hello 

    I have the same problem.

    The Exception provide from this line <AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(uri).Result;>

    System.AggregateException : 'Une ou plusieurs erreurs se sont produites.'

    NullReferenceException : La référence d'objet n'est pas définie à une instance d'un objet.

    The same method to connect from a console application works..

    Wednesday, June 10, 2020 2:54 PM
  • As the message says, you have a task which threw an unhandled exception.

    Turn on Break on All Exceptions (Debug, Exceptions) and rerun the program. This will show you the original exception when it was thrown in the first place.

    In VS2019 select Debug > Options > Debugging > General and unselect the "Enable Just My Code" option.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, June 10, 2020 8:37 PM