Thursday, June 3, 2010

The Most Helpful Web Page For Custom Website ISV Deployment for CRM 4.0

I have been extending CRM 4.0 for quite a while now, and it wasn't until recently that I had to do a custom ASPX page that would run in the context of the current user using IFD authentication. I knew I had to use the CrmAuthenticationToken.ExtractCrmAuthenticationToken(Context, orgName) method, but I didn't understand how the site needs to be set up in IIS.

Here's the key: If you want to do this, you DON'T make a new website or virtual directory. You just put the aspx files and the bin folder in the ISV folder of the root of the CRM website.

I figured this out by finding an amazing web page from Microsoft that answered all my questions. Here it is:

Important things to note:

  • You can put dll's in the bin folder in the application's folder in the ISV folder of the root of the website if you have installed Rollup Update 2
  • You must do all of your configuration in other ways from the web.config
  • If you are using a web application project, you must explicitly reference the dll in the @Assembly page directive in your aspx pages.

I hope this saves you some pain and time.