0

我正在尝试使用以下代码从网站运行 SSIS 包:

Process process = new Process();
        try
        {
            process.StartInfo.UseShellExecute = false;

            process.StartInfo.RedirectStandardOutput = true;

            process.StartInfo.FileName = "dtexec";

            process.StartInfo.Arguments = "/F " + ConfigurationManager.AppSettings["SSISLocation"] + packageName + " /ConF \"" + configLocation + "\"";

            System.IO.File.AppendAllText(ConfigurationManager.AppSettings["SSISLocation"] + "Log.txt", "/F " + ConfigurationManager.AppSettings["SSISLocation"] + packageName + " /ConF \"" + configLocation + "\"\r\n");

            process.Start();
            System.IO.File.AppendAllText(ConfigurationManager.AppSettings["SSISLocation"] + "Log.txt", process.StandardOutput.ReadToEnd() + "\r\n");                                
            process.WaitForExit();

            return true;
        }

这失败了,我的日志返回: 由于错误 0x800401F3 无法创建 DTS.Application

我已经用谷歌搜索了这个,但没有太多帮助,所以我通过命令行运行了这个包。所以我认为它必须是权限,所以我运行 psexec 来让我在网站运行的网络服务用户下获得一个命令窗口。它仍然有效,但仍然无法通过我的网站工作。

我没有运行 64 位,机器本身是 32 位,所以即使我运行它也无法在命令行上运行。

正在访问的文件夹对“所有人”具有完全权限

我正在运行 sql server 2005。

我正在运行 Windows Server 2003

我已经在所有组件上设置了延迟验证,而不会引起问题。

我已经为这两种方法运行了进程监视器,并且调用看起来几乎相同,但无论如何它们都在这里:

通过命令行:

父 PID:4292,命令行:dtexec /F c:\SSIS\packagename.dtsx /ConF "c:\SSIS\1cee35d1-b181-4ee7-a1de-eb9fc9c5ebe7.dtsConfig",当前目录:C:\WINDOWS\system32,环境:=C:=C:\WINDOWS\system32 =ExitCode=00000000 ALLUSERSPROFILE=C:\Documents and Settings\All Users ClusterLog=C:\WINDOWS\Cluster\cluster.log CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME =servername ComSpec=C:\WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK=NO lib=C:\Program Files\SQLXML 4.0\bin\ NUMBER_OF_PROCESSORS=2 OS=Windows_NT Path=C:\WINDOWS\system32;C:\WINDOWS; C:\WINDOWS\System32\Wbem;C:\Program Files\Dell\SysMgt\oma\bin;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\ 90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1. 0;C:\Program Files\Microsoft\Web 平台安装程序\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS;. PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules \ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS\视窗\视窗\视窗\视窗\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web Platform Installer\PATHEXT=.COM;.EXE;。 BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles= C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1 \LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web Platform Installer\PATHEXT=.COM;.EXE;。 BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles= C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1 \LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web 平台安装程序\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;. WSF;.WSH;.VBS;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\ system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1 \LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web 平台安装程序\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;. WSF;.WSH;.VBS;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\ system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1 \LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWSPSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules \ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWSPSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules \ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS\DOCUME~1\NETWOR~1\LOCALS~1\Temp TMP=C:\DOCUME~1\NETWOR~1\LOCALS~1\Temp USERDOMAIN=NT AUTHORITY USERNAME=NETWORK SERVICE USERPROFILE=C:\Documents and Settings\NetworkService windir=C:\WINDOWS

通过网站:

父 PID:3692,命令行:“dtexec”/F c:\SSIS\RNReport.dtsx /ConF“c:\SSIS\1cee35d1-b181-4ee7-a1de-eb9fc9c5ebe7.dtsConfig”,当前目录:c:\windows\ system32\inetsrv,环境:ALLUSERSPROFILE=C:\Documents and Settings\All Users APP_POOL_ID=AppPoolName ClusterLog=C:\WINDOWS\Cluster\cluster.log CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=servername ComSpec=C:\ WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK=NO lib=C:\Program Files\SQLXML 4.0\bin\ NUMBER_OF_PROCESSORS=2 OS=Windows_NT 路径=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\ Wbem;C:\Program Files\Dell\SysMgt\oma\bin;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\; C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1. 0;C:\Program Files\Microsoft\Web 平台安装程序\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS;. PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot =C:\WINDOWS TEMP=C:\WINDOWS\TEMP TMP=C:\WINDOWS\TEMP USERPROFILE=C:\Documents and Settings\默认用户windir=C:\WINDOWS\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web 平台安装程序\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;. WSF;.WSH;.VBS;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1. 0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\WINDOWS\TEMP TMP=C:\WINDOWS\TEMP USERPROFILE=C:\Documents and Settings\默认用户windir=C:\WINDOWS\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft\Web 平台安装程序\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;. WSF;.WSH;.VBS;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1. 0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\WINDOWS\TEMP TMP=C:\WINDOWS\TEMP USERPROFILE=C:\Documents and Settings\默认用户windir=C:\WINDOWS正版Intel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\WINDOWS\TEMP TMP =C:\WINDOWS\TEMP USERPROFILE=C:\Documents and Settings\默认用户windir=C:\WINDOWS正版Intel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2501 ProgramFiles=C:\Program Files PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\WINDOWS\TEMP TMP =C:\WINDOWS\TEMP USERPROFILE=C:\Documents and Settings\默认用户windir=C:\WINDOWS

任何帮助将不胜感激。

干杯

4

1 回答 1

0

尝试从控制台应用程序运行相同的 SSIS 包,如果它有效,则尝试在网站中运行相同的包。如果它在控制台而不是在网站中运行。然后检查您托管网站的位置。例如,如果您在 IIS 中托管您的网站,则可能存在在 IIS 中执行 ManagedDTS.dll 的权限。

为了解决这个问题,我必须从网站运行控制台应用程序,然后控制台应用程序依次运行我的 SSIS 包。这只是建议并继续尝试。根据您的说法,如果包通过命令行成功运行但不是通过代码运行,那么罪魁祸首是 ManagedDTS.dll。

于 2015-03-14T13:58:47.177 回答