【问题标题】:Getting warning in Visual Studio 2015 when add Microsoft.SqlServer.ManagedDTS with: Targets a different processor than the application添加 Microsoft.SqlServer.ManagedDTS 时在 Visual Studio 2015 中收到警告:针对与应用程序不同的处理器
【发布时间】:2016-04-29 16:14:57
【问题描述】:

我在尝试开始调试时收到这些警告。我构建了一个执行 dtsx 的 Windows 窗体应用程序。

当我在本地机器上运行 dtsx 时,结果是成功,但是当我运行 Windows 窗体应用程序时,结果是失败。

我的系统是:

  1. 处理器:Intel Core I5 3210M CPU @ 2.50Ghz
  2. 内存:8GB
  3. 操作系统:Windows 10 x64

我尝试了很多方法来解决它:

  1. 在 参考部分没有运气。

  2. 在 App.config 中添加一行:startup useLegacyV2RuntimeActivationPolicy="true"

  3. 添加并重新安装 SQL 2014 客户端工具 SDK 功能。

  4. 为 Visual Studio 2015 添加更多功能。

  5. 平台目标:任何 CPU,x86 和 x64 都没有运气。

  6. 我将此链接用作参考和许多其他链接,因此我做了很多研究:https://msdn.microsoft.com/en-us/library/ms136090.aspx

  7. SSIS - Visual Studio 2013 高级版

警告:

Severity    Code    Description Line    Suppression State
Warning     Referenced assembly 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\Microsoft.SqlServer.Msxml6_interop\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Msxml6_interop.dll' targets a different processor than the application. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets    3505    
Warning     Referenced assembly '\\tsclient\C\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.DTSRuntimeWrap.dll' targets a different processor than the application. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets   3505    
Warning     Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 1819

frmSSIS:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;

namespace alerts_operations
{
    public partial class frmSSIS : Form
    {
        public frmSSIS()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void btnFTP_Click(object sender, EventArgs e)
        {
            Microsoft.SqlServer.Dts.Runtime.Application myApplication = new Microsoft.SqlServer.Dts.Runtime.Application();

            //Package myPackage = myApplication.LoadPackage(@"C:\ftp_extract.dtsx", null);
            Microsoft.SqlServer.Dts.Runtime.Package myPackage = myApplication.LoadPackage(@"V:\ftp_extract.dtsx",null);

            lblStatus.Text = "Executing package...";

            Microsoft.SqlServer.Dts.Runtime.DTSExecResult myResult = myPackage.Execute();

            // Show the execution result

            lblStatus.Text = "Package result: " + myResult.ToString();
        }
    }
}   

构建日志:

'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'Z:\ACOLON\Projects\operations\operations\bin\Debug\operations.vshost.exe'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x2348 has exited with code 0 (0x0).
The thread 0x1c24 has exited with code 0 (0x0).
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'Z:\ACOLON\Projects\operations\operations\bin\Debug\operations.exe'. Symbols loaded.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ManagedDTS.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\Microsoft.SqlServer.DTSRuntimeWrap\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.DTSRuntimeWrap.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.Diagnostics.STrace\12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Diagnostics.STrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SqlServer.ScriptTask\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ScriptTask.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SqlServer.VSTAScriptingLib\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.VSTAScriptingLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\Microsoft.SqlServer.Msxml6_interop\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Msxml6_interop.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SqlServer.DtsMsg\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.DtsMsg.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SqlServer.ExecProcTask\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ExecProcTask.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\Microsoft.SqlServer.SQLTask\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.SQLTask.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'ST_9d880699f696403b9ab1169dab706d45'. Module was built without symbols.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Diagnostics\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Diagnostics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.Install.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.ConsoleHost.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Utility.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Management.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Management.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e35\Microsoft.Management.Infrastructure.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Security.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.WSMan.Management\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.WSMan.Management.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'Anonymously Hosted DynamicMethods Assembly'. 
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Management.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Tracing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Tracing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x7e0 has exited with code 0 (0x0).
'operations.vshost.exe' (CLR v4.0.30319: operations.vshost.exe): Loaded 'ST_c01711d8321445bcbe1c4f5abc4dee25'. Module was built without symbols.
The thread 0x246c has exited with code 0 (0x0).
The thread 0x54 has exited with code 0 (0x0).
The thread 0x1df0 has exited with code 0 (0x0).
The program '[7748] operations.vshost.exe' has exited with code 0 (0x0).

还有其他替代方案、选项或建议来解决这个问题吗?

【问题讨论】:

    标签: c# sql-server ssis visual-studio-2015 dts


    【解决方案1】:

    我在 ASP.NET 应用程序中多次出现过这种类型的错误。将与应用程序关联的所有项目的构建设置更改回任何 CPU(看起来您已经这样做了),并手动删除所有项目目录中的 /bin 和 /obj 文件夹通常有效。我还确保在删除这些文件夹之前关闭 Visual Studio。

    【讨论】:

    • 我删除了它,但仍然是同样的问题。
    猜你喜欢
    • 2014-10-11
    • 1970-01-01
    • 1970-01-01
    • 2016-06-05
    • 1970-01-01
    • 2018-09-03
    • 1970-01-01
    • 2011-03-15
    • 2016-04-28
    相关资源
    最近更新 更多