locked
CrmSvc Util with /codeCustomization with CRm 2016 SDK RRS feed

  • Question

  • 1) Can I use CRmOrganizationServiceContext for online CRM deployment ?

    2)I want to create the Xrm.cs file using the CRMSvcUtil and want the CRMOrganizationServiceContext  class as well

    CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration"

    /url:""  /out:"Xrm.cs" /servicecontextname:"XrmServiceContext" /username:"" /password:""

    pause

    However it gives me the exception

    Exiting program with exception: Could not load file or assembly 'CrmSvcUtil, Ver
    sion=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its de
    pendencies. The located assembly's manifest definition does not match the assemb
    ly reference. (Exception from HRESULT: 0x80131040)
    CrmSvcUtil Error: 2 : Exiting program with exit code 2 due to exception : System
    .IO.FileLoadException: Could not load file or assembly 'CrmSvcUtil, Version=7.0.
    0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencie
    s. The located assembly's manifest definition does not match the assembly refere
    nce. (Exception from HRESULT: 0x80131040)
    File name: 'CrmSvcUtil, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf385
    6ad364e35'
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
    Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntP
    tr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
    Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pP
    rivHostBinder, Boolean loadTypeFromPartialName)
       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean
    ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
       at System.Type.GetType(String typeName, Boolean throwOnError)
       at Microsoft.Crm.Services.Utility.ServiceFactory.CreateInstance[TIService](TI
    Service defaultServiceInstance, String parameterValue, CrmSvcUtilParameters para
    meters)
       at Microsoft.Crm.Services.Utility.ServiceProvider.InitializeServices(CrmSvcUt
    ilParameters parameters)
       at Microsoft.Crm.Services.Utility.CrmSvcUtil.get_ServiceProvider()
       at Microsoft.Crm.Services.Utility.CrmSvcUtil.Run()
       at Microsoft.Crm.Services.Utility.CrmSvcUtil.Main(String[] args)

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\M
    icrosoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure lo
    gging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
    ion!EnableLog].

    CrmSvcUtil Error: 2 : ===== DETAIL ======
    CrmSvcUtil Error: 2 : Source    : mscorlib
    Method  : GetTypeByName
    Date    : 11:35:27
    Time    : 24/06/2016
    Error   : Could not load file or assembly 'CrmSvcUtil, Version=7.0.0.0, Culture=
    neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The locate
    d assembly's manifest definition does not match the assembly reference. (Excepti
    on from HRESULT: 0x80131040)
    Stack Trace     : at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
     throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle
    stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandle
    OnStack type)
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
    Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pP
    rivHostBinder, Boolean loadTypeFromPartialName)
       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean
    ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
       at System.Type.GetType(String typeName, Boolean throwOnError)
       at Microsoft.Crm.Services.Utility.ServiceFactory.CreateInstance[TIService](TI
    Service defaultServiceInstance, String parameterValue, CrmSvcUtilParameters para
    meters)
       at Microsoft.Crm.Services.Utility.ServiceProvider.InitializeServices(CrmSvcUt
    ilParameters parameters)
       at Microsoft.Crm.Services.Utility.CrmSvcUtil.get_ServiceProvider()
       at Microsoft.Crm.Services.Utility.CrmSvcUtil.Run()
       at Microsoft.Crm.Services.Utility.CrmSvcUtil.Main(String[] args)
    ================================================================================
    ======================================

    Please help


    • Edited by MiracleSim Friday, June 24, 2016 10:56 AM
    Friday, June 24, 2016 10:53 AM