C# Visual Studio 2017中Windows嵌入式手持设备6.5项目的UI设计器例外

C# Visual Studio 2017中Windows嵌入式手持设备6.5项目的UI设计器例外,c#,visual-studio,windows-mobile,windbg,windows-embedded-compact,C#,Visual Studio,Windows Mobile,Windbg,Windows Embedded Compact,我知道Visual Studio 2017不支持Windows嵌入式手持设备6.5,需要Visual Studio 2005或2008。不过,最近新的硬件仍在运行此移动操作系统,但无法访问VisualStudio2008。而且我也不想为一个我再也不想开发的平台一次性购买它 我已经找到了在Windows 10上的Visual Studio 2017中为该平台构建项目的变通方法,并执行了以下操作。并非所有这些步骤都是必要的,因为我正在尝试让它工作 安装和 用于为创建转换以删除MSI+中的Visual

我知道Visual Studio 2017不支持Windows嵌入式手持设备6.5,需要Visual Studio 2005或2008。不过,最近新的硬件仍在运行此移动操作系统,但无法访问VisualStudio2008。而且我也不想为一个我再也不想开发的平台一次性购买它

我已经找到了在Windows 10上的Visual Studio 2017中为该平台构建项目的变通方法,并执行了以下操作。并非所有这些步骤都是必要的,因为我正在尝试让它工作

  • 安装和
  • 用于为创建转换以删除MSI+中的Visual Studio先决条件检查并删除一些未能安装的组件
  • 然后安装对于生成项目时引发的任何错误,无法将CompactFramework.targets文件归档,请将安装在C:\windows\microsoft.net\Framework\v3.5中的.targets文件复制到所需文件夹中
  • 使用C:\windows\microsoft.net\Framework\v3.5\msbuild文件下载并构建这些文件工作正常,并且输出EXE在移动设备上运行正常
  • 要使用Visual Studio编辑项目,我必须从ProjectTypeGUIDs中删除{4D628B5B-2FBC-4AA6-8C16-197242AEB884}。一旦我将项目从.NET2.0升级到.NET3.5,我现在就可以在VisualStudio中构建项目,并且它在移动设备上运行良好。(尽管我目前正在将文件手动复制到设备)
  • 最后一个问题是设计师抛出的错误,这不是一个真正的止损点,但很好解决

    找不到类型“System.Windows.Forms.Form”。请确保 将引用包含此类型的程序集。如果这种类型是 作为开发项目的一部分,请确保项目已完成 使用当前平台或任何应用程序的设置成功生成 中央处理器

    在本例中,项目引用的是C:\Program Files(x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll

    将WinDbg连接到Visual Studio可获得以下信息:

    :021> sxe -c "!pe;!clrstack" clr
    0:021> g
    (2504.3c8c): CLR exception - code e0434352 (first chance)
    Exception object: 29885a70
    Exception type:   System.ComponentModel.Design.Serialization.CodeDomSerializerException
    Message:          Could not find type 'System.Windows.Forms.Form'.  Please make sure that the assembly that contains this type is referenced.  If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
    InnerException:   <none>
    StackTrace (generated):
    <none>
    StackTraceString: <none>
    HResult: 80131501
    OS Thread Id: 0x3c8c (0)
    Child SP       IP Call Site
    00afe48c 7613b802 [HelperMethodFrame: 00afe48c] 
    00afe53c 0b13e901 System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(System.ComponentModel.Design.Serialization.IDesignerSerializationManager, System.String, System.String)
    00afe558 0b13c78d System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(System.ComponentModel.Design.Serialization.IDesignerSerializationManager, System.CodeDom.CodeTypeDeclaration)
    00afe63c 0b138058 System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(System.ComponentModel.Design.Serialization.IDesignerSerializationManager)
    00afe650 1950b386 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(System.ComponentModel.Design.Serialization.IDesignerSerializationManager)
    00afe680 0efb22e5 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(System.ComponentModel.Design.Serialization.IDesignerLoaderHost)
    00afe6b4 0efb1f02 System.ComponentModel.Design.DesignerHost.BeginLoad(System.ComponentModel.Design.Serialization.DesignerLoader)
    00afe6e0 0efb1d51 System.ComponentModel.Design.DesignSurface.BeginLoad(System.ComponentModel.Design.Serialization.DesignerLoader)
    00afe6f0 19509608 Microsoft.VisualStudio.Design.DesignerService.Microsoft.VisualStudio.Designer.Interfaces.IVSMDDesignerService.CreateDesigner(System.Object, System.Object)
    00afe72c 77240423 Microsoft.VisualStudio.LanguageServices.Implementation.AbstractEditorFactory.CreateEditorInstance(UInt32, System.String, System.String, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy, UInt32, IntPtr, IntPtr ByRef, IntPtr ByRef, System.String ByRef, System.Guid ByRef, Int32 ByRef)
    00afe7a4 5b1be1ba DomainNeutralILStubClass.IL_STUB_COMtoCLR(Int32, IntPtr, IntPtr, IntPtr, Int32, Int32, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr)
    00afe8a4 713ceec4 [ComMethodFrame: 00afe8a4] 
    00afefe0 713ceec4 [InlinedCallFrame: 00afefe0] 
    00afefdc 5b1d0174 DomainNeutralILStubClass.IL_STUB_CLRtoCOM(UInt32, System.Guid ByRef, UInt32, UInt32, IntPtr, IntPtr)
    00afefe0 5b3831d7 [InlinedCallFrame: 00afefe0] Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy.ExecCommand(UInt32, System.Guid ByRef, UInt32, UInt32, IntPtr, IntPtr)
    00aff054 5b3831d7 Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities+c__DisplayClass35_0.b__1()
    00aff07c 5b35d1e0 Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(System.Func`1, Boolean, Boolean)
    00aff0a8 5b379063 Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities.ExecHierParentChain(Microsoft.VisualStudio.Shell.IVsHierarchyItemManager, Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy, Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy, UInt32, System.Guid ByRef, UInt32, UInt32, IntPtr, IntPtr)
    00aff0e8 15751277 Microsoft.VisualStudio.PlatformUI.HierarchyItem+HierarchyInvocationController.Invoke(System.Collections.Generic.IEnumerable`1, Microsoft.Internal.VisualStudio.PlatformUI.InputSource, Boolean)
    00aff114 292eb2bb Microsoft.Internal.VisualStudio.PlatformUI.InvocationController.Invoke(System.Collections.Generic.IEnumerable`1, Microsoft.Internal.VisualStudio.PlatformUI.InputSource, Boolean, System.Func`2)
    00aff178 292eb1a2 Microsoft.Internal.VisualStudio.PlatformUI.InvocationController.Invoke(System.Collections.Generic.IEnumerable`1, Microsoft.Internal.VisualStudio.PlatformUI.InputSource, Boolean)
    00aff1a0 292eab3a Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeViewItem.InvokeItem(System.Windows.Input.InputDevice)
    00aff1d8 292ea13e Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeViewItem.OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs)
    00aff1e8 5a41402c System.Windows.UIElement.OnMouseLeftButtonDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
    00aff1fc 5a4766ec System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
    00aff208 59ff969e System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
    00aff22c 59ff962f System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
    00aff240 59ff92ee System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
    00aff2ac 5a418765 System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
    00aff2ec 5a413d62 System.Windows.UIElement.OnMouseDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
    00aff2fc 5a4766ec System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
    00aff308 59ff969e System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
    00aff32c 59ff962f System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
    00aff340 59ff92ee System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
    00aff3ac 59ff8123 System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
    00aff3e8 5a00baa6 System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
    00aff414 59ff808a System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
    00aff424 5a008c43 System.Windows.Input.InputManager.ProcessStagingArea()
    00aff47c 5a008935 System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
    00aff48c 5a00889e System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
    00aff4a4 5a014a92 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
    00aff4a8 5a798b01 [InlinedCallFrame: 00aff4a8] 
    00aff53c 5a798b01 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
    00aff5bc 59ff2aab System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    00aff5e0 5ac7ee3b MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    00aff61c 5ac7ed8b MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
    00aff62c 5ac7ec52 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
    00aff64c 5ac7eb94 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
    00aff690 5ac7d225 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
    00aff6ec 5ac7e72e MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
    First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=00afe378 ebx=00000005 ecx=00000005 edx=00000000 esi=00afe438 edi=00000001
    eip=7613b802 esp=00afe378 ebp=00afe3d0 iopl=0         nv up ei pl nz ac pe nc
    cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000216
    KERNELBASE!RaiseException+0x62:
    7613b802 8b4c2454        mov     ecx,dword ptr [esp+54h] ss:002b:00afe3cc=8c7cfc55
    0:000> !DumpObj /d 29885a70
    Name:        System.ComponentModel.Design.Serialization.CodeDomSerializerException
    MethodTable: 0b1612a4
    EEClass:     1962f90c
    Size:        88(0x58) bytes
    File:        C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Design\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Design.dll
    Fields:
          MT    Field   Offset                 Type VT     Attr    Value Name
    6fc91d64  400028e        4        System.String  0 instance 00000000 _className
    6fc90200  400028f        8 ...ection.MethodBase  0 instance 00000000 _exceptionMethod
    6fc91d64  4000290        c        System.String  0 instance 00000000 _exceptionMethodString
    6fc91d64  4000291       10        System.String  0 instance 2988581c _message
    6fca0864  4000292       14 ...tions.IDictionary  0 instance 00000000 _data
    6fc91eac  4000293       18     System.Exception  0 instance 00000000 _innerException
    6fc91d64  4000294       1c        System.String  0 instance 0a76e208 _helpURL
    6fc92104  4000295       20        System.Object  0 instance 00000000 _stackTrace
    6fc92104  4000296       24        System.Object  0 instance 00000000 _watsonBuckets
    6fc91d64  4000297       28        System.String  0 instance 00000000 _stackTraceString
    6fc91d64  4000298       2c        System.String  0 instance 00000000 _remoteStackTraceString
    6fc93c04  4000299       3c         System.Int32  1 instance        0 _remoteStackIndex
    6fc92104  400029a       30        System.Object  0 instance 00000000 _dynamicMethods
    6fc93c04  400029b       40         System.Int32  1 instance -2146233087 _HResult
    6fc91d64  400029c       34        System.String  0 instance 00000000 _source
    6fc910f8  400029d       44        System.IntPtr  1 instance        0 _xptrs
    6fc93c04  400029e       48         System.Int32  1 instance -532462766 _xcode
    6fc4b104  400029f       4c       System.UIntPtr  1 instance        0 _ipForWatsonBuckets
    6fc9a014  40002a0       38 ...ializationManager  0 instance 29885ac8 _safeSerializationManager
    6fc92104  400028d       5c        System.Object  0   shared   static s_EDILock
        >> Domain:Value  00e2ad28:0a91e320 <<
    6ef4cc74  40009d8       50 ...om.CodeLinePragma  0 instance 00000000 linePragma
    
    :021>sxe-c“!pe;!clrstack”clr
    0:021>g
    (2504.3c8c):CLR异常-代码e0434352(首次机会)
    异常对象:29885a70
    异常类型:System.ComponentModel.Design.Serialization.CodeDomainSerializerException
    消息:找不到类型“System.Windows.Forms.Form”。请确保引用了包含此类型的程序集。如果此类型是开发项目的一部分,请确保已使用当前平台或任何CPU的设置成功构建该项目。
    内部异常:
    StackTrace(已生成):
    堆栈跟踪限制:
    HResult:80131501
    操作系统线程Id:0x3c8c(0)
    子SP IP呼叫站点
    00afe48c 7613b802[帮助方法框架:00afe48c]
    00afe53c 0b13e901 System.ComponentModel.Design.Serialization.CodeDomainSerializerBase.Error(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.String,System.String)
    00afe558 0b13c78d System.ComponentModel.Design.Serialization.TypeCodeDomainSerializer.Deserialize(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.CodeDom.CodeTypeDeclaration)
    00afe63c 0b138058 System.ComponentModel.Design.Serialization.CodeDomainDesignerLoader.PerformLoad(System.ComponentModel.Design.Serialization.IDesignerSerializationManager)
    00afe650 1950b386 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomainDesignerLoader.PerformLoad(System.ComponentModel.Design.Serialization.IDesignerSerializationManager)
    00afe680 0efb22e5 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(System.ComponentModel.Design.Serialization.IDesignerLoaderHost)
    00afe6b4 0efb1f02 System.ComponentModel.Design.DesignerHost.BeginLoad(System.ComponentModel.Design.Serialization.DesignerLoader)
    00afe6e0 0efb1d51 System.ComponentModel.Design.DesignSurface.BeginLoad(System.ComponentModel.Design.Serialization.DesignerLoader)
    00afe6f0 19509608 Microsoft.VisualStudio.Design.DesignerService.Microsoft.VisualStudio.Designer.Interfaces.IVSMDDesignerService.CreateDesigner(System.Object,System.Object)
    00afe72c 77240423 Microsoft.VisualStudio.LanguageServices.Implementation.AbstractEditorFactory.CreateEditorInstance(UInt32,System.String,System.String,Microsoft.VisualStudio.Shell.Interop.IVsHierarchy,UInt32,IntPtr,IntPtr ByRef,IntPtr ByRef,System.String ByRef,System.Guid ByRef,Int32 ByRef)
    00afe7a4 5b1be1ba域中性子类。IL_STUB_COMtoCLR(Int32、IntPtr、IntPtr、IntPtr、Int32、Int32、IntPtr、IntPtr、IntPtr、IntPtr)
    00afe8a4 713ceec4[通用方法框架:00afe8a4]
    00afefe0 713ceec4[内嵌调用帧:00afefe0]
    00afefdc 5b1d0174 DomainNeutralListSubclass.IL_STUB_CLRtoCOM(UInt32,System.Guid ByRef,UInt32,UInt32,IntPtr,IntPtr)
    00afefe0 5b3831d7[InlinedCallFrame:00afefe0]Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy.ExecCommand(UInt32,System.Guid ByRef,UInt32,UInt32,IntPtr,IntPtr)
    00aff054 5b3831d7 Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities+c__显示类35_0.b__1()
    00aff07c 5b35d1e0 Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(System.Func`1,布尔值,布尔值)
    00aff0a8 5b379063 Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities.ExecuthierParentChain(Microsoft.VisualStudio.Shell.IVsHierarchyItemManager,Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy,Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy,UInt32,System.Guid ByRef,UInt32,UInt32,IntPtr,IntPtr)
    00aff0e8 15751277 Microsoft.VisualStudio.PlatformUI.HierarchyItem+HierarchyInvocationController.Invoke(System.Collections.Generic.IEnumerable`1,Microsoft.Internal.VisualStudio.PlatformUI.InputSource,布尔值)
    00aff114 292eb2bb Microsoft.Internal.VisualStudio.PlatformUI.InvocationController.Invoke(System.Collections.Generic.IEnumerable`1,Microsoft.Internal.VisualStudio.PlatformUI.InputSource,布尔值,System.Func`2)
    00aff178 292eb1a2 Microsoft.Internal.VisualStudio.Pl