locked
CRM 2013 Console App RRS feed

  • Question

  • Does any one have any sample/ or reference article regarding how to create console app on CRM 2013 on-premise?? i tried one given by Microsoft as shown below, but i am getting error....

    "An unhandled exception of type 'System.Configuration.ConfigurationErrorsException' occurred in Microsoft.Xrm.Client.dll 

    Additional information: A configuration element with the name 'Xrm' under the 'contexts' collection does not exist."

    http://msdn.microsoft.com/en-us/library/gg695803.aspx

    Wednesday, June 25, 2014 2:40 PM

Answers

  • If you follow that tutorial you need to add the xml string inside you app.config file (step number 9)


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:00 PM
    Wednesday, June 25, 2014 2:44 PM
  • I already have that as shown below, it is still giving that error. i also double check all the parameters for generating Xrm file and also redid 3 times entire process, its same error.

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Wednesday, June 25, 2014 3:21 PM
  • did you try to uncomment the microsoft.xrm.client lines?

    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Thursday, June 26, 2014 6:33 AM
  • yes i did. no luck. does that have to do any thing with PC .net frame work ??
    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Thursday, June 26, 2014 12:35 PM
  • I don't think so, however I didn't see your C# code, but you can use the simplified connection:

    CrmConnection crmConnection = CrmConnection.Parse("Url=https://XXX.crm.dynamics.com; Username=user@domain.onmicrosoft.com; Password=passwordhere;");
    OrganizationService service = new OrganizationService(crmConnection);

    and take the string from the app.config using the ConfigurationManager class.


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Thursday, June 26, 2014 12:50 PM

All replies

  • If you follow that tutorial you need to add the xml string inside you app.config file (step number 9)


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:00 PM
    Wednesday, June 25, 2014 2:44 PM
  • I already have that as shown below, it is still giving that error. i also double check all the parameters for generating Xrm file and also redid 3 times entire process, its same error.

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Wednesday, June 25, 2014 3:21 PM
  • did you try to uncomment the microsoft.xrm.client lines?

    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Thursday, June 26, 2014 6:33 AM
  • yes i did. no luck. does that have to do any thing with PC .net frame work ??
    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Thursday, June 26, 2014 12:35 PM
  • I don't think so, however I didn't see your C# code, but you can use the simplified connection:

    CrmConnection crmConnection = CrmConnection.Parse("Url=https://XXX.crm.dynamics.com; Username=user@domain.onmicrosoft.com; Password=passwordhere;");
    OrganizationService service = new OrganizationService(crmConnection);

    and take the string from the app.config using the ConfigurationManager class.


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Marked as answer by Nicksoft2011 Wednesday, July 23, 2014 3:01 PM
    Thursday, June 26, 2014 12:50 PM