我一直收到错误"收集被修改;枚举操作可能无法执行"。
在winform的设计模式下。项目运行良好,只是设计时间有问题。
在打开和关闭项目X次(到目前为止在1到10+之间)后,这会消失,但总是随机返回(即使没有对项目或其任何依赖项进行任何更改)。 / p>
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) 在System.Collections.Generic.List
1.Enumerator.MoveNextRare() at System.Collections.Generic.List
1.Enumerator.MoveNext() 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblySpecFound(List1 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.AssemblySpecFound(List
1个程序集,String assemblyFullName) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AddProjectDependencies(项目项目) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly() 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName,String typeName,Boolean ignoreTypeCase,Boolean allowPrivate,Assembly& assembly,String description) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName,String typeName,Boolean ignoreTypeCase,Assembly& assembly,String description) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName,String typeName,Boolean ignoreTypeCase,Assembly& assembly) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName,String typeName,Boolean ignoreCase,Assembly& assembly,ReferenceType refType) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName,String typeName,Boolean ignoreTypeCase,Assembly& assembly) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name,Boolean throwOnError) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name) 在Microsoft.VisualStudio.Design.VSDynamicTypeService.OnAssemblyResolve(Object sender,ResolveEventArgs e) 在System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly程序集,String assemblyFullName) at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly,String name,Boolean throwOnError,Boolean ignoreCase,ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name,Boolean throwOnError,Boolean ignoreCase) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName,String typeName,Boolean ignoreTypeCase,Boolean allowPrivate,Assembly& assembly,String description) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName,String typeName,Boolean ignoreTypeCase,Assembly& assembly,String description) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName,String typeName,Boolean ignoreTypeCase,Assembly& assembly) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName,String typeName,Boolean ignoreCase,Assembly& assembly,ReferenceType refType) 在Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName,Boolean throwOnError,Boolean ignoreCase,ReferenceType refType) 在Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name,Boolean throwOnError,Boolean ignoreCase) 在Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name) 在System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetRuntimeType(String typeName) 在System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName) 在System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(IDesignerSerializationManager manager,String name,Dictionary2 names) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary
2 names,CodeStatementCollection statements,String className) 在System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager,CodeTypeDeclaration declaration) 在System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) 在Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) 在Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
答案 0 :(得分:2)
我认为这是Visual Studio 2012 Update 4中修复的错误:
Windows窗体
您可能会在Windows窗体设计器中收到以下错误消息:
收藏被修改;枚举操作可能无法执行