title: Collection was modified; enumeration operation may not execute in VS WinForms Designer
body: <p>Since converting our company inhouse winforms application from a VS2008 to VS2012 project I have problems using the winforms designer.</p>
  
  <p>Sometimes the designer falls into an error state giving the following error message:</p>
  
  <p>"Collection was modified; enumeration operation may not execute." with the call stack saying:</p>
  
  <pre><code>Instances of this error (1)  
  
  1.   Hide Call Stack 
  
  at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
  at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
  at System.Collections.Generic.List`1.Enumerator.MoveNext()
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblySpecFound(List`1 assemblies, String assemblyFullName)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.AddDependencies(Assembly a, String fileName)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchByShortName(String partialName, String fullName, AssemblyEntry[] entries, Assembly&amp; assembly)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchNormalEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly&amp; assembly, Boolean fastSearch)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly&amp; assembly, ReferenceType refType)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly&amp; assembly)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name, Boolean throwOnError)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name)
  at Microsoft.VisualStudio.Design.VSDynamicTypeService.OnAssemblyResolve(Object sender, ResolveEventArgs e)
  at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)  
  </code></pre>
  
  <p>It seems that the designer is trying to change the list of referenced assemblies maybe because of some invalid assemblies.
  While trying to solve the issue I figured out that changing the "Enable ClickOnce Security" option under Project->Properties->Security can bring the designer back to work. BUT if the option is turned on and I get the designer error turning it off and rebuild all can solve the problem from time to time and VICE VERSA!!!! ... That's why I'm a little lost right now. </p>