Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
12/29/2008 3:15:12 AM
Gravatar
Total Posts 88

Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

Hi Joe, hope you had a nice Christmas.

Since upgrade I haven't been able to run setup/default.aspx without an internal server error . I navigated to /Data/ but there is no currentlog.config file ?

However, my host has identified this web.config error:

Config Error: "Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Integrated'"

Config Source

831: <add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />

832: <add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" resourceType="Unspecified" preCondition="integratedMode" />

833: <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

 

 

thks,

Leah

12/29/2008 3:37:32 AM
Gravatar
Total Posts 118

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc

Remove the following section from webconfig and try it - worked for me

 

Neil

<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" resourceType="Unspecified" preCondition="integratedMode" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers> 

12/29/2008 3:44:40 AM
Gravatar
Total Posts 88

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc

Thanks, that seems to have done the trick. Are there any implications for commenting out this section of the code?

 

12/29/2008 4:03:02 AM
Gravatar
Total Posts 118

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc

I havent found any yet - This is my first install and at the moment I am jusy playing but it appears ok 

12/29/2008 6:04:31 AM
Gravatar
Total Posts 18439

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

Hi Leah and Neil,

Apparently a pattern is emerging with this problem. I'm thinking I need to go ahead and comment out the problem parts there to avoid other people having this issue.

Since I can't reproduce this on my machine for some reason, it would help to know what is the minimum things that need to be commented out to fix it? Neil, could you try commenting out just these 2 lines and tell me if that is sufficient?

<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" resourceType="Unspecified" preCondition="integratedMode" />

or does it really require taking out more to fix it?

This section is not essential now but is going to be important in the future for web services, so I'd like to be able to leave in the needed parts and just isolate the problems.

Best,

Joe

12/29/2008 6:24:03 AM
Gravatar
Total Posts 88

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc

Hi Joe,

I know you directed the question at Neil but as I'm sitting at my PC I gave this a quick go. If I only comment out the two parts you suggested I get a System.OutOfMemoryException error, with the following stack trace:


[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +29
System.Web.Compilation.CompilationUtil.GetTypeFromAssemblies(AssemblyCollection assembliesCollection, String typeName, Boolean ignoreCase) +132
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +291
System.Web.UI.Page.get_ScriptManagerType() +44
System.Web.UI.Page.get_IsPartialRenderingSupported() +61
System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript() +22
System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +53
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6741
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
System.Web.UI.Page.ProcessRequest() +80
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.secure_login_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

[Exception: Unhandled Exception while processing NeatUpload child request]
Brettle.Web.NeatUpload.UploadHttpModule.Application_BeginRequest(Object sender, EventArgs e) +1149
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
 

12/29/2008 6:31:43 AM
Gravatar
Total Posts 18439

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

Hi Leah,

Thanks for the help! Ouch, that's quite a bad error, might need a reboot after that.

I guess I'll have to comment out the whole <handlers section until I can research it more and figure out whats going on there.

Best,

Joe

12/29/2008 6:34:13 AM
Gravatar
Total Posts 18439

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

Hi Leah,

Just for reference, are you seeing this error on Vista or a Win 2008 machine, or something else? What OS?

Best,

Joe

12/29/2008 6:39:26 AM
Gravatar
Total Posts 88

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc

Hi Joe, I am using Windows XP.

Yep I keep getting the same system.outofmemory exception now, despite having re-commented the <handlers> section. Going to try and reboot etc, hopefully that will cure it...

thks,

Leah

12/29/2008 6:53:24 AM
Gravatar
Total Posts 18439

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

Hi Leah,

Do you have .NET 3.5 SP1 installed?

Whats wierd is I don't get this error on my Vista dev machine nor on my production server running Win 2003 IIS6. Both environements are up to date with .NET 3.5 SP1.

Note that .NET 3.5 does not come down as a windows update and is not installed automatically, it has to be explicitly installed by downloading it from here then installing it.

I do not think it is installed automatically by default even on Win 2008 server.

Best,

Joe

12/29/2008 6:58:09 AM
Gravatar
Total Posts 118

Re: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'svc-Int

 

Joe

Just tried removing

<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" resourceType="Unspecified" preCondition="integratedMode" />

And it works fine on Win2008 - If you need somewhere to do testing on win2008 - let me know.

 

Regards

Neil

You must sign in to post in the forums. This thread is closed to new posts.