C#Winforms程序在一台计算机上运行而不是在另一台计算机上

时间:2016-04-12 15:40:21

标签: c# .net winforms visual-studio-2015

我在C#中为我工作的地方编写了一个程序,如标题所述,它在一台计算机(我的主要工作计算机)上工作,但在另一台计算机上工作(我的备用工作计算机)。

以下是两台计算机的详细信息:

我的主计算机,我拥有本地管理员权限,是我用于在Visual Studio 2015 Express中创建此程序的计算机,安装了这些.NET框架,并且我专门在此程序中使用了该版本。 (我必须将两个屏幕截图合并为一个,因为我没有足够的声誉来附加超过2个文件):

Main Computer .Net Frameworks Installed & Used

我的备用计算机我没有安装这些.NET框架的管理员权限:

Spare Computer .Net Frameworks Installed

我在我的主计算机上使用Visual Studio内置的发布功能将此程序部署到我的备用计算机,但是当我尝试运行setup.exe时,我收到一个错误,产生了这个输出:

PLATFORM VERSION INFO
    Windows             : 6.1.7601.65536 (Win32NT)
    Common Language Runtime     : 4.0.30319.17929
    System.Deployment.dll       : 4.0.30319.17929 built by: FX45RTMREL
    clr.dll             : 4.0.30319.17929 built by: FX45RTMREL
    dfdll.dll           : 4.0.30319.17929 built by: FX45RTMREL
    dfshim.dll          : 4.0.41209.0 (Main.041209-0000)
SOURCES
    Deployment url          : file:///C:/Local%20Files/Temp/QTC%20251.1%20Data%20Verification%20Tool.application
    Application url         : file:///C:/Local%20Files/Temp/Application%20Files/QTC%20251.1%20Data%20Verification%20Tool_1_0_0_0/QTC%20251.1%20Data%20Verification%20Tool.exe.manifest
IDENTITIES
    Deployment Identity     : QTC 251.1 Data Verification Tool.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2223067c4825c23a, processorArchitecture=msil
    Application Identity        : QTC 251.1 Data Verification Tool.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2223067c4825c23a, processorArchitecture=msil, type=win32
APPLICATION SUMMARY
    * Installable application.
ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Local Files\Temp\QTC 251.1 Data Verification Tool.application resulted in exception. Following failure messages were detected:
        + Failed to load the runtime. (Exception from HRESULT: 0x80131700)
COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.
WARNINGS
    There were no warnings during this operation.
OPERATION PROGRESS STATUS
    * [4/12/2016 11:28:21 AM] : Activation of C:\Local Files\Temp\QTC 251.1 Data Verification Tool.application has started.
    * [4/12/2016 11:28:21 AM] : Processing of deployment manifest has successfully completed.
    * [4/12/2016 11:28:21 AM] : Installation of the application has started.
    * [4/12/2016 11:28:21 AM] : Processing of application manifest has successfully completed.
    * [4/12/2016 11:28:23 AM] : Found compatible runtime version 4.0.30319.
    * [4/12/2016 11:28:23 AM] : Request of trust and detection of platform is complete.
    * [4/12/2016 11:28:24 AM] : Downloading of subscription dependencies is complete.
    * [4/12/2016 11:28:24 AM] : Commit of the downloaded application has started.
ERROR DETAILS
    Following errors were detected during this operation.
    * [4/12/2016 11:28:24 AM] System.Runtime.InteropServices.COMException
        - Failed to load the runtime. (Exception from HRESULT: 0x80131700)
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.NativeMethods.GetRequestedRuntimeInfo(String pExe, String pwszVersion, String pConfigurationFile, UInt32 startupFlags, UInt32 runtimeInfoFlags, StringBuilder pDirectory, UInt32 dwDirectory, UInt32& dwDirectoryLength, StringBuilder pVersion, UInt32 cchBuffer, UInt32& dwLength)
            at System.Deployment.Application.Win32InterOp.SystemUtils.CheckSupportedImageAndCLRVersions(String path)
            at System.Deployment.Application.SubscriptionStore.CheckApplicationPayload(CommitApplicationParams commitParams)
            at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams)
            at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

在进行一些Google搜索之后,我相信这告诉我.NET程序创建时的问题以及备用计算机上的版本,但它们都是4.5,所以我不知道如何解决它。

我不明白为什么这两个不同的.NET Framework 4.5不能一起工作。

有没有办法让我解决这个问题,以便它可以在我的备用计算机和其他几台计算机上工作而无需安装任何东西?

感谢您的帮助。

0 个答案:

没有答案