Delen via


Custom ASPX assemblies

With the release of UR2 we provide developers a more convenient place to put their custom ASPX assemblies.

As the SDK points out, whenever developers want to host their custom ASPX application within the context of the CRM web app they should put their ASPX pages under their custom directory in the form of <crmwebroot>\ISV\<yourapp>. That is all good and fine except that before UR2 developers had to place any assemblies (dlls) under <crmwebroot>\bin or the GAC which is not ideal. With UR2, assemblies can be placed under <crmwebroot>\ISV\<yourapp>\bin which a lot cleaner from a deployment perspective… but there is a small catch, your ASPX pages need to have an @Assembly directive specifying the name of the assembly (just the name not the path); this is a restriction that we found with the way .net loads assemblies. True, it is not ideal to have to add the @Assembly directive but, in my opinion, it is preferable than having to share a single \bin folder with other solution developers that may (voluntarily or involuntarily) interfere with your solution assemblies. We will be updating our SDK documentation and writing a technical article shortly on the matter to reflect this best practice. [Update... we already updated the SDK doc: https://msdn.microsoft.com/en-us/library/dd548493.aspx ]

Comments

  • Anonymous
    February 03, 2009
    PingBack from http://www.clickandsolve.com/?p=3384

  • Anonymous
    February 04, 2009
    Be aware that the code runs under the same App Domain and process, meaning if a custom code throws an unhandled exception, this will cause an error to the whole CRM process pool.

  • Anonymous
    February 05, 2009
    Rasmus: You are correct; I just want to clarify that that has always been the case with CRM4 and the ISV folder.  In other words, UR2 doesn't introduce any new restrictions on that matter. There are very good reasons why you may want to run under the same app pool as CRM  (e.g. surface your application in IFD deployments).  Also there are also reasons why you may want to have your own website. As mentioned before documentation is on its way to illustrate some of the scenarios.

  • Anonymous
    February 25, 2009
    Hello, i have installed the Update Rollup 2  for CRM 4.0. In my case, my aspx custom files are deployed in a folder named <crmwebroot>ISVORGANIZATION_NAMEPAGES and the assembly for that files is deployed in a folder called <crmwebroot>ISVORGANIZATION_NAMEbin I have added the directive @Assembly with the name of the assembly in all custom pages. Then when i try to access to any custom page from the browser i got an error. The error is raised because the assembly that contains the code-behind for that page is not found. If i move the assembly from <crmwebroot>ISVORGANIZATION_NAMEbin to <crmwebroot>bin the page works fine. Any idea? Thanks.

  • Anonymous
    March 09, 2009
    The comment has been removed

  • Anonymous
    March 18, 2009
    Hello Humberto, I am working on implementing this solution, and have run into an issue on the aspx page that I am deploying. When navigating to the page published under /ISV/CustomApp I simply recieve a blank page. I have the aspx page at the root of /ISV/CustomApp, and I have the dll in /ISV/CustomApp/bin. I have added the following assembly directive: <%@ Assembly Name="CustomApp.dll" %> (note without the .dll added I recieve an error that the assembly can not be located). This works just fine in VS, however once published to CRM, it does not work. Thanks

  • Anonymous
    March 18, 2009
    Jay, You don't need to include ".dll" just the assembly name.    Not sure why you are getting a blank page.  Make sure you turn deverrors on (on the CRM web.config), it may help you diagnose the problem. Also make sure that the @Assembly directive is the first thing you put in your ASPX page.  

  • Anonymous
    July 01, 2009
    your article is very good nice post thank you, keep posting

  • Anonymous
    September 29, 2009
    Hi, I have been struggling with this and I can't get it to work. I have several DLLs in my web project. One is the DLL for the web application and several others are library DLLs. I put them all in the /ISV/MyApp/bin folder and added an assembly reference in the page to each but I just get "Could not load file or assembly 'MyApp.Page1' or one of its dependencies". I tried only having the assembly reference for the page but I get the same thing. This is with UR4.

  • Anonymous
    September 29, 2009
    Berono, It is hard to troubleshoot without actually seeing your environment. My recommendation is to contact support. Out of curiosity, can you post the code (the assembly reference) that you are using in your custom page?

  • Anonymous
    February 18, 2010
    Hi Humberto, I have a technical issue, possibly. My assembly name contains a dot (CompanyName.FeatureName.dll). When I use Assembly directive specifying Name without the .dll CRM reports an error. When I add the .dll to the Name, then no error occurs, but I get blank page. The only way it works is to change assmebly name to one without dot and use it in directive without .dll. By the way, the dotted-named assembly put in CRMWeb/bin works as expected. And now comes a question: is it possible to use dots in assembly name with custom aspx inside CRM/ISV? Or maybe I am the only person experiencing this issue? Regards, Maciej