Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified or Deploying custom web application inside ISV folder of CRM 2011

To deploy our custom web application inside ISV folder of CRM 2011 we need to follow the below steps

Make following changes in the web.config

<configuration>
<configSections>
<remove name=crm.authentication />
</configSections>
<system.web>
<httpModules>
<clear/>
</httpModules>

……………………

And after deploying the application within the ISV folder, place the following dlls within its bin folder

  • AntiXssLibrary.dll
  • Microsoft.Crm.dll
  • Microsoft.Crm.Sdk.dll
  • Microsoft.Crm.Platform.Sdk.dll

We can find these dll’s inside

../Microsoft Dynamics CRM/Server/Bin folder.

The above solution worked perfectly for Beta Versions of CRM 2011.

Recently we upgraded to RTM, and we had to deploy a WCF Service and custom web site inside isv.

For WCF service we had to make following changes to the web.config apart from the changes mentioned above

<serviceHostingEnvironment aspNetCompatibilityEnabled=”false”>
</serviceHostingEnvironment>
</system.serviceModel>

And in case of custom web site we had to add the following additional dll’s

  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.Xrm.Sdk.dll

Hope it helps!


41 thoughts on “Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified or Deploying custom web application inside ISV folder of CRM 2011

  1. This is the perfect web site for everyone who hopes to find out about this topic.
    You realize so much its almost hard to argue with
    you (not that I personally would want to…HaHa).

    You certainly put a new spin on a topic which has been discussed for years.

    Great stuff, just excellent!

  2. Nice post. I learn something new and challenging on blogs I stumbleupon every day.
    It’s always exciting to read articles from other writers
    and use something from their sites.

  3. It’s the best time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I wish to suggest you
    some interesting things or advice. Maybe you could write next
    articles referring to this article. I want to read
    even more things about it!

  4. Hello it’s me, I am also visiting this site regularly,
    this website is really fastidious and the people are in fact sharing fastidious thoughts.

  5. Fantastic goods from you, man. I’ve understand your stuff previous to and you’re just extremely great.

    I really like what you’ve acquired here, certainly like what you are stating and the way in which you say it.
    You make it enjoyable and you still take care of to keep it wise.
    I cant wait to read much more from you. This
    is actually a great website.

  6. Pingback: CRM 2011 – Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ - Hosk's Dynamic CRM 2011 Blog - CRM Technical Blogs - Microsoft Dynamics Community

  7. Pingback: CRM 2011 – Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ « Hosk's Dynamic CRM 2011 Blog

  8. Pingback: Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified or Deploying custom web application inside ISV folder of CRM 2011

  9. Pingback: Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified or Deploying custom web application inside ISV folder of CRM 2011

  10. I have a question. I have a web application hosted in side the ISV folder, my installation is claim configured, when accessing the page from isv folder i get the error page not found. What should be the reason…? im not able to solve the isuse….

  11. I’m trying to put WCF data service in ISV folder. That service need to access other database for integration purpose. I followed all the steps and it’s keep on asking user name and password when I browse that service. After three times of asking credential it’s shows blank. Any idea on that?? Please help me. Thanks in advance.

  12. i am getting handler error when executing the button click event when the web page is deployed to ISV folder. But when the page is hosted as separate application it runs correctly. Please let me know why it behaves like this.

  13. Well, I am not a developer but I got to deploy a project which actually send fax using the fax services on windows 2008 server 64bit. the project was developed on a windows 32bit platform and I was setting all the information according to the given instruction but still I this annoying error and then I found the solution and that was to change the platform from anycpu to x86 and it worked. for a complete setting list please follow the link below:
    http://www.sizledcore.com/2011/10/could-not-load-file-or-assembly/

  14. Hey itvti,

    It’s just like Nishant posted.
    I had the same problem as you until I realised that I forgot to state the

    below the system.web tag.
    This clears the settings of the machine.config and doesn’t request all these dlls anymore.

    Thorsten

  15. It’s working when,

    I added the httmodule clear tag in web.config
    and added the dlls in application bin folder
    •AntiXssLibrary.dll
    •Microsoft.Crm.dll
    •Microsoft.Crm.Platform.Sdk.dll

  16. It’s working when,

    I added the tag in web.config

    and added the dlls in application bin folder
    •AntiXssLibrary.dll
    •Microsoft.Crm.dll
    •Microsoft.Crm.Platform.Sdk.dll

  17. It’s working when,

    I added the tag in web.config

    and added following dlls in application bin folder

    •AntiXssLibrary.dll
    •Microsoft.Crm.dll
    •Microsoft.Crm.Platform.Sdk.dll

    • Hi Luiz,

      Let me know how can I help you.
      Putting those dlls in the bin worked for me, that’s why I had suggested it on my blog.
      But as you can see somebody mentioning in comment to the post that he had to put some other dlls as well to get things working.

      Earlier I used to get error on deploying application inside ISV, however in one of the developers forum, I saw someone suggesting to put all the dlls of the server/bin folder of crm to the bin folder of the custom web application. Give that a try as well.

      Regards,
      Nishant Rana

  18. In our case the three DLLs aren’t enough. We had to copy the following DLLs for the Custom-Page to run inside the CRM Website (with its own VDir and NET4/Classic AppPool):

    AntiXssLibrary.dll
    Microsoft.Crm.Admin.AdminService.dll
    Microsoft.Crm.ADUtility.dll
    Microsoft.Crm.dll
    Microsoft.Crm.ObjectModel.dll
    Microsoft.Crm.Platform.Sdk.dll
    Microsoft.Crm.Platform.Server.dll
    Microsoft.Crm.Sdk.dll
    Microsoft.Crm.Tools.ActiveDsWrapper.dll
    Microsoft.Crm.Tools.Admin.DMSnapinLib.dll
    Microsoft.Crm.WebServices.dll

    (in addition to the SDK DLLs:
    microsoft.crm.sdk.proxy.dll
    microsoft.xrm.sdk.dll)

    What I would be interested to know is if there is a better way to solve this issue since you have to keep in mind that CRM Updates might change those DLLs.

  19. Hi Nishant,

    I deployed the application using VS (Publish). The error is the same you solved: Could not load file or assembly ‘Microsoft.Crm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified

    I started an application from scratch. This time I didn’t convert from 4.0. I did a new one using CRM 2011 and VS 10. I got the same error.

    Regards,

    Luiz

    • Hi Luiz,
      When i am doing it, it is working absolutely fine for me.
      I am also creating a new blank website, simply adding a default.aspx page in it.
      And then publishing it inside ISV folder of CRM.
      After publishing just placing the above mentioned dll’s inside the bin folder.

      Regards,
      Nishant Rana

    • Hi ,
      What steps have you followed for deploying your application and what error are you getting ?

      Try the steps mentioned in the post with some other simple web application first. If it succeeds then try with your application.

      Regards,
      Nishant Rana

  20. Hi Nishant,

    I did what you said but still I am getting the same error:

    Could not load file or assembly ‘Microsoft.Crm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified.

    Here it is my web.config.

    <!–
    The section enables configuration
    of the security authentication mode used by
    ASP.NET to identify an incoming user.

    –>

    <!–
    The section enables configuration
    of what to do if/when an unhandled error occurs
    during the execution of a request. Specifically,
    it enables developers to configure html error pages
    to be displayed in place of a error stack trace.

    –>

    Let me give you some history about what I did:
    1) I have a tool (magicQuestionnaire) running for CRM 4.0 inside many IFrames
    2) I upgraded the environment to CRM 2011
    3) I upgraded my project to VS 2010, .Net 4
    4) I changed the web.config to include the entries you suggested
    5) I Built the project to ISV/magicQuestionnaire Web Application
    6) I got the warning “The element ‘configSections’ has invalid child element ‘remove'” but I am ignoring it
    7) I published the project to the ISV/magicQuestionnaire folder as I was doing before in CRM 4.0
    6) I copied the three dlls from CRM 2011 bin folder to ISV/magicQuestionnaire/bin folder

    What I am doing wrong? Please help me.

    Also, I noticed that I get the same error if I try to change the project to release and build it. It fails with the same error message. It only rebuild if I leave the project as debug

    Thanks in advance,

    Luiz

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s