locked
CrmSvcUtil for mobile purpose does not work RRS feed

  • General discussion

  • Hello Everyone,

    Currently I am trying to get early bound entity classes running in a Visual Studio project. My project is a Windows store app which connects to a CRM 2015 cloud version.

    I am using the following Statement in the command line for crmsvc util: (I use mobile Extension for crmsvcutil)

    CrmSvcUtil.exe /url:https://mycrm.crm4.dynamics.com/XRMServices/2011/Organization.svc   /out:GeneratedCode.cs /username:"bla@bla.onmicrosoft.com" /password:"none" /codeCustomization:"Microsoft.Crm.Sdk.Samples.CodeCustomizationService, CrmSvcMobileUtil"  /namespace:Xrm 

    However in the GeneratedCode.cs there are still references to the: Microsoft.Xrm.Sdk.Entity

    As far as I know I can't reference to Microsoft.Xrm.Sdk.Entity because the Windows rt is not supported in a Windows Store app. As a result the generated code is not suitable for my project.

    I attached a codefile where you can see the reference to Microsoft.Xrm.Sdk.Entity.

    public System.Collections.Generic.IEnumerable<Xrm.ActivityParty> OptionalAttendees
    		{
    			get
    			{
    				Microsoft.Xrm.Sdk.Samples.EntityCollection collection = this.GetAttributeValue<Microsoft.Xrm.Sdk.Samples.EntityCollection>("optionalattendees");
    				if (((collection != null) 
    							&& (collection.Entities != null)))
    				{
    					return System.Linq.Enumerable.Cast<Xrm.ActivityParty>(collection.Entities);
    				}
    				else
    				{
    					return null;
    				}
    			}
    			set
    			{
    				if ((value == null))
    				{
    					this.SetAttributeValue("optionalattendees", value);
    				}
    				else
    				{
    					this.SetAttributeValue("optionalattendees", new Microsoft.Xrm.Sdk.Samples.EntityCollection(new System.Collections.Generic.List<Microsoft.Xrm.Sdk.Entity>(value)));
    				}
    				this.OnPropertyChanged("OptionalAttendees");

    Do you have any idea what the missing point could be ? Maybe I am doing something wrong in my command line statement?

    Please let me know if you need further clarification.

    Best Regards,

    Tobias

    Wednesday, January 28, 2015 8:32 AM

All replies

  • In case other people face a similar situation. This helped me out:

    1. Download a tool from: code.msdn.microsoft.com/CRM-Service-Utility-for-4ca0c93b.

    2. Extract the zip.

    3. Open CrmSvcMobileUtil.sln In the extracted foloder.

    4. Add latest CrmSvcUtil.exe and Microsoft.Xrm.Sdk.dll as Reference to the project.

    5. Open FilteringService.cs and modify GenerateEntity method. Specify entities you want to use, or simply return true to generate all.

    6. Build the project.

    7. Go to folder where dll is generated.

    8. Execute command below. >CrmSvcUtil.exe

    /codecustomization:"Microsoft.Crm.Sdk.Samples.CodeCustomizationService,CrmSvcMobileUtil" /codewriterfilter:"Microsoft.Crm.Sdk.Samples.FilteringService,CrmSvcMobileUtil" /url:<your org endpoing> /username:<user> /password:<password> /out:XrmData.cs /namespace:<ns>


    Friday, January 30, 2015 7:53 AM