none
VS2012若要在加载设计器前避免可能发生的数据丢失 RRS feed

  • 问题

  • 报出的错误是未将对象引用设置到对象的实例

    已经检查过窗体绘制代码跟窗体载入事件   没看到哪里是null数据

    下面给出调用堆栈

    在 System.Resources.Tools.StronglyTypedResourceBuilder.Create(IDictionary resourceList, String baseName, String generatedCodeNamespace, String resourcesNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)
    在 System.Resources.Tools.StronglyTypedResourceBuilder.Create(IDictionary resourceList, String baseName, String generatedCodeNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.BuildType()
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.GetObjectType()
    在 Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.get_Children()
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.CreateGlobalObjectsForItem(ProjectItem item, GlobalObjectCollection oldObjects, GlobalObjectCollection newObjects, ITypeResolutionService typeResolver)
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.CreateGlobalObjectsForItem(ProjectItem item, GlobalObjectCollection oldObjects, GlobalObjectCollection newObjects, ITypeResolutionService typeResolver)
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.CreateGlobalObjects(Project project)
    在 Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.GetGlobalObjectsCore(Project project, Type baseType)
    在 Microsoft.VisualStudio.Shell.Design.GlobalObjectProvider.GetGlobalObjects(Project project, Type baseType)
    在 Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType)
    在 Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase)
    在 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)
    在 System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(IDesignerSerializationManager manager, String name, Dictionary`2 names)
    在 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) 

    2014年12月17日 11:10

答案

  • 您好,

    请问你在创建什么程序的时候得到这个问题? 如果创建一个简单的程序,是不是还有这个问题?

    首先我们要确定是所有程序都有问题还是具体的某一个程序有问题,对于designer加载有问题,以前有遇到固定的某一个项目有问题,建议你打开项目文件夹,删除.suo文件,重新打开项目文件.xxproj试试。或者创建一个空的solution,把projects添加到空的solution看一下结果。

    当然如果所有的程序都有问题,那就要考虑VS IDE,请安装VS2012 update 4. 重置VS settings,创建一个新的程序检查结果。

    希望能帮助你!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年12月18日 10:51
    版主