You may notice that if you try and upload(register) a plugin > 1024 KB you’ll get an error similar to this (sorry for the shoddy formatting):
One of the potential reasons for getting this error could be that your plugin is over 1024 KB.
This is caused by a few lines in the web.config located at C:\Program Files\Microsoft Dynamics CRM\CRMWebweb.config
Inside that file scroll down and look for something like this:
<!--Specific settings for the MSCRMServices directory--><locationpath="MSCRMServices"><system.web><httpRuntimemaxRequestLength="8192"/>
Since the Plugin Registration tool uses web services, this is the area we want to edit. You’re going to want to change this line here:
The trick here is that maxRequestLength is measured in kilobytes where as requestLengthDiskThreshold is measured in bytes. The above will give you up to 8 megs for your plugin (increase accordingly if your plugin is larger).
Why did you get the error though? Well, what requestLengthDiskThreshold does is determines how much of the request to hold in memory. If it goes over the requestLengthDiskThreshold it starts to write it temporarily to disk. The user account (or service) that’s being used doesn’t have the permission to write to wherever it’s buffering to and it crashes out. The default for requestLengthDiskThreshold is 1024KB (which is when it would start buffering it to disk).
I would’ve loved to spend the time to find out where and by who it’s being buffered to but unfortunately as of right now I just don’t have the time. If you know what permissions need to be set where please leave a comment. This might not be the most elegant solution, but it solves the issue for now. Be prepared to wait quite a bit longer while the file uploads via the Plugin Registration tool.
This is valuable knowledge for my upcoming post on how to hook many dll’s into 1 dll, which can cause the plugin to bloat into the 6-8 meg range.
Edit July 20,2011 – This also fixes the error “The page was not displayed because the request entity is too large” in IIS7 when trying to upload large CRM 2011 reports.