12 September 2009

CRM ISV Add-On : The entry 'ScriptModule' has already been added

I tested a CRM 4.0 add-on (ISV-A) last week, the default ASPX page generated an error:

Parser Error Message: The entry 'ScriptModule' has already been added.
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</httpmodules>
</SYSTEM.WEB>



The add-on was located under the folder: CRMWeb\ISV\MyAddon
Of cause it inherits settings from CRM's root web.config: in which the ScriptModule has been added by another ISV's (ISV-B) add-on(it shouldn't do it at all).

But if I remove the ScriptModule from ISV-A's web.config, the error changed to:

Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.

That's because the .Net version of ScriptModule are different between ISV-A and ISV-B's, so we have to stop ScriptModule(ISV-A's) inheriting from CRM's root web.config.

So that what I need to do on ISV-A's web.config:

Just before the ScriptModule, add a <remove> tag, which will remove the inherited setting:

<remove name="ScriptModule">
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

2 comments:

Unknown said...

Keep up the fantastic piece of work, I read few blog posts on this web site and I believe that your site is real interesting and has lots of great information. ERP Software in Mumbai || System Software || CRM Software in Mumbai || MLM Software

Unknown said...

I really appreciate spending some time to talk about that, I believe firmly regarding this and so really enjoy understanding more about this kind of subject.This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this. CRM Software || MLM Software in Mumbai || ERP Software || System Software in Mumbai