locked
Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, RRS feed

  • Question

  •  

    We are having problems with SDK 5.0.3. We have a modified customer service portal application which compiles and accesses our CRM 2011 IFD configuration using both the internal and out external addresses. Under the DLLs out of SDK 5.0.2, the portal is able to connect and operate as long as we do not attempt to specify a domain in the connection string.

     

    When we installed and updated the references in both projects to the SDK 5.0.3 DLLs however, we get this error message.  Reinstalling the SDK 5.0.2 DLLs and rebuilding the solution causes the problem to go away. Please advise how to begin working with the 5.0.3 files:

     

    These errors occur in a visual studio 2010 environment on a Windows 7 64-bit machine running indebug mode.  I have carefully isolated all references to SDK DLLs to focus on a single directory.

     

    Server Error in '/' Application.

     

    Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

     

    Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

     

    Source Error:

     

     

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

     

     


    === Pre-bind state information ===
    LOG: User = domain\useraccount
    LOG: DisplayName = Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
     (Fully-specified)
    LOG: Appbase = file:///H:/Devo/CSPortal2011MSFT/CustomerPortal/Web/
    LOG: Initial PrivatePath = H:\Devo\CSPortal2011MSFT\CustomerPortal\Web\bin
    Calling assembly : Microsoft.Xrm.Portal, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: H:\Devo\CSPortal2011MSFT\CustomerPortal\Web\web.config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/9b8f77c0/b502e87/Microsoft.Xrm.Client.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/9b8f77c0/b502e87/Microsoft.Xrm.Client/Microsoft.Xrm.Client.DLL.
    LOG: Attempting download of new URL file:///H:/Devo/CSPortal2011MSFT/CustomerPortal/Web/bin/Microsoft.Xrm.Client.DLL.
    WRN: Comparing the assembly name resulted in the mismatch: Build Number
    ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

    Stack Trace:

     

     


    [FileLoadException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
       Microsoft.Xrm.Portal.Configuration.PortalCrmSection..cctor() +0

    [TypeInitializationException: The type initializer for 'Microsoft.Xrm.Portal.Configuration.PortalCrmSection' threw an exception.]
       System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) +0
       System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) +15
       System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +461
       System.Reflection.ConstructorInfo.Invoke(Object[] parameters) +17
       System.Configuration.TypeUtil.InvokeCtorWithReflectionPermission(ConstructorInfo ctor) +35
       System.Configuration.RuntimeConfigurationFactory.CreateSectionImpl(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader) +43
       System.Configuration.RuntimeConfigurationFactory.CreateSectionWithFullTrust(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader) +50
       System.Configuration.RuntimeConfigurationRecord.CreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader) +74
       System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line) +75

    [ConfigurationErrorsException: An error occurred creating the configuration section handler for microsoft.xrm.portal: The type initializer for 'Microsoft.Xrm.Portal.Configuration.PortalCrmSection' threw an exception.]
       System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line) +285
       System.Configuration.BaseConfigurationRecord.CreateSectionDefault(String configKey, Boolean getRuntimeObject, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object& result, Object& resultRuntimeObject) +59
       System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +1468
       System.Configuration.BaseConfigurationRecord.GetSection(String configKey) +41
       System.Web.HttpContext.GetSection(String sectionName) +52
       System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName) +57
       System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey) +6
       System.Configuration.ConfigurationManager.GetSection(String sectionName) +78
       Microsoft.Xrm.Portal.Configuration.PortalCrmConfigurationManager.GetPortalCrmSection() +30
       Microsoft.Xrm.Portal.Web.Modules.PortalRoutingModule.Init(HttpApplication application) +36
       System.Web.HttpApplication.InitModulesCommon() +80
       System.Web.HttpApplication.InitModules() +43
       System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
       System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
       System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

     

    Pasted from <http://localhost:54144/>


    Stephen V Noe, CRM MCT
    Sunday, May 1, 2011 2:57 PM

Answers

  • The 5.0.3 SDK was re-released once it was determined it was missing an assembly.  Please re-download it.  This will resolve the problem you are having with the portal SDK.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Proposed as answer by Jim Glass Jr Monday, May 16, 2011 5:23 PM
    • Marked as answer by Stephenvnoe Tuesday, May 17, 2011 5:51 PM
    Saturday, May 7, 2011 10:56 PM
    Moderator
  • Yes, ILMERGE is required.  The Microsoft.Xrm.Client.dll is not installed on the server, so when your plugin is deployed, .Net cannot find it.  The ILMERGE utility will merge the reference assembly with yours so that everything you need is in your assembly.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Marked as answer by Jim Glass Jr Monday, May 16, 2011 5:23 PM
    Monday, May 16, 2011 1:55 PM
    Moderator

All replies

  • Hii Stephenvnoe,

     

    Im also having same issue have you got through or not?

    can you please tell me if you reslove it.

     

    Thanks  Users MedalsUsers MedalsUsers MedalsUsers Medals


    JayakrishnaK
    Wednesday, May 4, 2011 5:49 AM
  • I am having the same isue (Could not load file or assembly 'Microsoft.Xrm.Client) with a simple plugin using the 5.0.3 SDK.  Any thoughts on a fix for this?

     

    Thanks,

     

    Lindsey


    LSM
    Wednesday, May 4, 2011 12:42 PM
  • The 5.0.3 SDK was re-released once it was determined it was missing an assembly.  Please re-download it.  This will resolve the problem you are having with the portal SDK.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Proposed as answer by Jim Glass Jr Monday, May 16, 2011 5:23 PM
    • Marked as answer by Stephenvnoe Tuesday, May 17, 2011 5:51 PM
    Saturday, May 7, 2011 10:56 PM
    Moderator
  • Hi Shan,

              I Downloaded the latest sdk from the link http://www.microsoft.com/downloads/en/details.aspx?FamilyID=420f0f05-c226-4194-b7e1-f23ceaa83b69 and updated in my website, but still getting the same error.


    JayakrishnaK
    Tuesday, May 10, 2011 5:58 AM
  • To overcome this problem (with the plugin), I copied the file Microsoft.Xrm.Client.dll from the SDK (5.0.3) to the bin folder of the server (C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin).  Seems to fix the issue for me.
    LSM
    • Proposed as answer by Jim Glass Jr Monday, May 16, 2011 5:23 PM
    • Unproposed as answer by Jim Glass Jr Monday, May 16, 2011 5:23 PM
    Tuesday, May 10, 2011 12:18 PM
  • Lindsey, the CRMWeb\bin folder has nothing to do with the portal - the portal is running in its own website and application pool.  This will not fix an issue of the portal not compiling.

    Jayakrishna, where did you put the files?  I suspect that you did not copy the assemblies to the correct folder in the customer portal.  The website in the customer portal is set to pull the SDK references from the CustomerPortal/Microsoft.Xrm/bin folder.  Copy the files from the SDK into this folder.  Also copy the WebsiteCopy.exe file to the CustomerPortal/Utilities folder.

     


    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    Tuesday, May 10, 2011 2:47 PM
    Moderator
  • Hi

    I have the same problem but i m working on Dynamics CRM 2011 online version.

     

    Have an idea about how to resolve it?

     

    Here is a print screen : http://www.cijoint.fr/cj201105/cij0s5Zgsb.png

     

    Thanks you for all.

    Friday, May 13, 2011 2:09 PM
  • The original poster's problem was related to compiling the portal.  In your case, you are deploying a plugin to a server that doesn't have the assembly.  What you have to do is use ILMERGE to merge the microsoft.xrm.client assembly (and any other assembly you take a dependency on) into your DLL before you deploy it to CRM Online.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    Friday, May 13, 2011 3:25 PM
    Moderator
  • HI SHAN,

     

    I m sorry to bother you but ILMERGE can't really resolve my problem i think because i m adding references (dll) in

     

    the c# class.

     

    Moreover, when i don't use one command line, it works...

     

    Here is the link of my problem: http://www.cijoint.fr/cj201105/cijRa2U8tU.png

     

    I thought my problem was in RegistrationTool, but before building solution, i added Microsoft.Xrm.Client as a reference,

     

    Normally i must work.

     

    How can i do?

    Monday, May 16, 2011 9:23 AM
  • Yes, ILMERGE is required.  The Microsoft.Xrm.Client.dll is not installed on the server, so when your plugin is deployed, .Net cannot find it.  The ILMERGE utility will merge the reference assembly with yours so that everything you need is in your assembly.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Marked as answer by Jim Glass Jr Monday, May 16, 2011 5:23 PM
    Monday, May 16, 2011 1:55 PM
    Moderator
  • Redownloading the SDK solved my issue without ILMERGE for a Customer Portal application in CRM 2011 upgraded from CRM 4.0. Keep up the good work Shan!
    Stephen V Noe, CRM MCT
    Tuesday, May 17, 2011 5:53 PM
  • I am getting the same issue for Microsoft.Xrm.Portal. Is this file missing from the Cloud servers as well?
    Sunday, May 22, 2011 3:51 PM
  • I don't understand what you mean by "is this file missing from the cloud servers as well?".  Can you clarify your question?

    For the rest of the thread, there are two separate issues - the first one being a mistake in the initial packaging of the 5.0.3 SDK which affects the portals, which is resolved by re-downloading the SDK.  The second issue is using the client SDK in a plugin, which requires the use of ILMERGE in order to bundle the dependent assemblies with the assembly running in a plugin.


    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    Sunday, May 22, 2011 4:44 PM
    Moderator
  • I am addressing the 2nd issue (using ILMerge to bundle references togather). I was successful in using ILMerge to combine my CustomPlugin.dll and microsoft.xrm.client.dll. I can successfully load this plugin into the CRM 2011 Online environment. However, when I make a CRM changes that triggers this plugin, it gives the following error:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): Membership.Membership: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Portal, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147220956</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Unexpected exception from plug-in (Execute): Membership.Membership: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Portal, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</Message>
      <Timestamp>2011-05-22T16:56:08.9521109Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText>[ASI.Membership: CustomPlugin.CustomPlugin]
    [f745f31c-8784-e011-960d-1cc1def13751: CustomPlugin.CustomPlugin: Create of new_customEntity]
    </TraceText>
    </OrganizationServiceFault>

    I tried to use ILMerge to package the microsoft.xrm.portal.dll as well, but when i try that, i get the following error:

    An exception occurred during merging:
    Unresolved assembly reference not allowed: Microsoft.ServiceBus.
       at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
       at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type)
       at System.Compiler.Ir2md.VisitReferencedType(TypeNode type)
       at System.Compiler.Ir2md.VisitClass(Class Class)
       at System.Compiler.Ir2md.VisitModule(Module module)
       at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
       at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation,
    BinaryWriter writer)
       at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols,
     Module module, Boolean delaySign, String keyFileName, String keyName)
       at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Modu
    le module)
       at ILMerging.ILMerge.Merge()
       at ILMerging.ILMerge.Main(String[] args)

    I am not sure what I am doing wrong? Some guidance would be greatly appreciated.

    Thank you, Mike Sood

    Sunday, May 22, 2011 4:58 PM
  • As an additional note, my plugin works perfectly with On-Premise implementations of CRM.
    Sunday, May 22, 2011 5:47 PM
  • I have also tried this ILMerge command:

    ilmerge /keyfile:CustomPlugin.snk /target:library /copyattrs /targetplatform:v4,"C:\Windows\Microsoft.NET\Framework\v4.0.30319" /out:"merged/CustomPluginMerged.dll" CustomPlugin.dll Microsoft.ServiceBus.dll AntiXssLibrary.dll microsoft.xrm.client.dll microsoft.xrm.portal.dll

    With this, I was able to include the Microsoft.Xrm.Portal.dll reference. But the error that comes up in CRM is the following:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): CustomPlugin.CustomPlugin: System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147220956</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Unexpected exception from plug-in (Execute): CustomPlugin.CustomPlugin: System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.</Message>
      <Timestamp>2011-05-22T18:12:14.8214212Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText>

    What security changes are needed, if any?

    Thanx, Mike

    Sunday, May 22, 2011 6:14 PM
  • No configuration changes are needed, but reading configuration may not be allowed.  We don't run the portals in plugins so we have never even tested deploying the portal DLL with a plugin - only the client.  What is in the portal dll that you need in your plugin?
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    Sunday, May 22, 2011 8:33 PM
    Moderator
  • Microsoft.Xrm.Portal.dll is used by our xrm.cs entity structure class. Are you saying this is not correct?

    Mike Sood

    Sunday, May 22, 2011 9:51 PM
  • The default generation would generate a data service for the CMS editing interfaces, but that service can be deleted - it isn't in your source code, and isn't needed for your plugin.  Look for a class like XrmCmsDataService in your xrm.cs file and comment it out.  You should be able to run the plugin without the portal framework.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    Sunday, May 22, 2011 11:59 PM
    Moderator
  • I removed the XrmCmsDataService from the xrm.cs, and now I get the following security error:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): Membership.Membership: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147220956</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Unexpected exception from plug-in (Execute): CustomPlugin.CustomPlugin: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</Message>
      <Timestamp>2011-05-23T04:57:05.8176698Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText>

    I sense that I am close. I really appreciate your assistance in solving my issue.

    Thank you, Mike Sood

    Monday, May 23, 2011 5:14 AM
  • Are we not permitted to use LINQ Queries in CRM Online? I have read that this is not premitted and QueryExpressions should be used instead. Is this correct? All of my plugins have been written based on the SDK, which uses LINQ.

    Mike Sood

    Monday, May 23, 2011 2:13 PM
  • Hi stephenvnoe,

    I had the same problem and resolved it for CRM 2011 but i don't understand with the crm 4.0, i can't resolve it. Same error when i'm using xrm.cs file generetad by the crmutil.exe

    Some on can help me?

    Here is the recurrent error message:

    Unhandled Exception: System.IO.FileNotFoundException: Impossible de charger le fichier ou l'assembly 'Microsoft.Xrm.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ou une de ses dépendances. Le fichier spécifié est introuvable.
       à System.Reflection.Assembly._GetExportedTypes()
       à System.Reflection.Assembly.GetExportedTypes()
       à PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
       à PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
       à PluginRegistrationTool.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly)
       à PluginRegistrationTool.PluginRegistrationForm.btnLoadAssembly_Click(Object sender, EventArgs e)

    Tuesday, February 21, 2012 5:19 PM
  • Hi,

    I cannot merge microsoft.xrm.client.dll  (version 5.0.9689.1985). The error I get from ILMerge is:

    An exception occurred during merging:
    Unresolved assembly reference not allowed: Presentation Framework.
         at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
         at .........

    ILMerge simplified command is:

    ILMerge /target:library /keyfile:WebServiceCaller.key.snk /out:"D:\Dev\out.dll" /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 WebServiceCaller.dll
    microsoft.xrm.client.dll

    What am I doing wrong and how did you get this dll to merge without errors ?

    Thanks for any answers, I need this working ASAP.





    Monday, April 2, 2012 9:08 PM
  • Hello,

     

    I'm getting the same error as Daniel here. Anybody has a suggestion??

    Thanks!

    Monday, April 16, 2012 7:02 AM
  • Hi,

    I had the same problem with crm 2011 online version. My plugin has references to Microsoft.Xrm.Client.dll(to use linq expression with early bound classes(classes that is generated by crmsvcutil).)

    It seems like crm 2011 online does not have the Microsoft.Xrm.Client.dll in its bin folder.
    I have tried the ILMerge tool but couldnt manage to make it work.

    What I ended up with is, removed the reference for Microsoft.Xrm.Client.dll, delete the class that I get it by crmsvcutil.
    And change my queries to use late bound classes instead.

    I think in SDK they should mention that for crm 2011 online you shouldnt use references to 
     Microsoft.Xrm.Client.dll within your plugin.

    Hope this info helps to somebody,



    Oğuz Erdeve


    • Edited by Oğuz Erdeve Tuesday, April 24, 2012 5:52 PM
    • Proposed as answer by Oğuz Erdeve Tuesday, April 24, 2012 5:54 PM
    Tuesday, April 24, 2012 5:51 PM
  • Hi,

    ... delete the class that I get it by crmsvcutil, and change my queries to use late bound classes instead...

    In my case, I did not I did not have to throw out the whole Xrm.cs. I needed to re-generate Xrm.cs without "/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration". I found the important tip here: http://vincenttechnotes.blogspot.fi/2011/12/crm-online-cant-find.html.

    When I took away "/codeCustomization:" from the command-line, Xrm.cs was no longer depending on Microsoft.Xrm.Client.dll, and would work fine.

    I had to change code where Money was involved:

    // This code
    aSalesOrder.PricePerUnit = aDoubleValue;
    // Changed to
    aSalesOrder.PricePerUnit = new Money(aDoubleValue);

    But otherwise I did not change my code. The plugin would work happily!

      - Mikael -


    Thursday, November 1, 2012 12:11 PM
  • Hi,

     Register Microsoft.Xrm.Client.dll in GAC of your server so that CRM will refer from them.

    And the other suggestion is to Merge the dll with plugin dll by using ILMERGE.


    Sreeni Pavalla

    Friday, January 18, 2013 3:05 PM