简体   繁体   English

我在Windows 10上使用VS2017编译了一个安装项目。它可以在XP上运行吗?

[英]I compiled a setup project with VS2017 on Windows 10. Can it run on XP?

I have created a setup project using Visual Studio 2017 and compiled it on Windows 10. It is written in C# WPF and the target framework is .NET Framework 4 . 我已经使用Visual Studio 2017创建了一个安装项目并在Windows 10上对其进行了编译。它是用C#WPF编写的,目标框架是.NET Framework 4 The target platform is Any CPU . 目标平台是Any CPU

Now that I have compiled the setup project, I am trying to run the MSI for it on Windows XP. 既然我已经编译了安装项目,那么我正在尝试在Windows XP上为其运行MSI。 The MSI runs successfully and installs the program, but the program will not open. MSI成功运行并安装了该程序,但该程序无法打开。 I am being shown an error message box that says: 我收到一个错误消息框,显示:

MyProgram has encountered a problem and needs to close. We are sorry for the inconvenience.

According to the computer events, a NotSupportedException error is occurring: 根据计算机事件,发生NotSupportedException错误:

Application: MyProgram.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NotSupportedException
Stack:
   at System.Net.ServicePointManager.set_SecurityProtocol(System.Net.SecurityProtocolType)
   at MyProgram.App.OnStartup(System.Windows.StartupEventArgs)
   at System.Windows.Application.<.ctor>b__1(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at System.Windows.Application.Run(System.Windows.Window)
   at MyProgram.App.Main()

Does anybody have any suggestions for how to fix this problem? 有人对如何解决此问题有任何建议吗? .NET Framework 4.0 is already installed on my Windows XP machine. Windows XP计算机上已经安装了.NET Framework 4.0。 Is there a setting in VS2017 that I need to change? VS2017中是否有需要更改的设置?

The main problem is in Visual Studio target platform, it have to be X86 otherwise it don't work in xp. 主要问题是在Visual Studio目标平台中,它必须是X86否则不能在xp中工作。 The others thinks looks ok. 其他人认为看起来还可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM