2009-08-28 17 views
0

でActiveXを呼び出すときにFileNotFoundExceptionエラーを取得:私は私のSSISパッケージでActiveXを呼び出す必要があるので、私は、スクリプトタスクを使用して、次のC#スクリプトを作成SSISスクリプトタスク

public void Main() 
{ 
    clsAptFdbReader objFdbReader = new clsAptFdbReader("UnitedStates20000830.fdb"); 
    objFdbReader.OpenFdb(false); 
    Dts.TaskResult = (int)ScriptResults.Success; 
} 

は、エラーを取得します。

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Interop.APTFDBReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.APTFDBReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at ST_320325ad8e2543f09ee688d809f58ee7.csproj.ScriptMain.Main()

=== Pre-bind state information === LOG: User = SHINETECHCHINA\xugy LOG: DisplayName = Interop.APTFDBReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (Fully-specified) LOG: Appbase = file:///C:/Program Files/Microsoft SQL Server/100/DTS/binn/ LOG: Initial PrivatePath = NULL Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files\Microsoft SQL Server\100\DTS\binn\DtsDebugHost.exe.Config LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SQL Server/100/DTS/binn/Interop.APTFDBReader.DLL. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SQL Server/100/DTS/binn/Interop.APTFDBReader/Interop.APTFDBReader.DLL. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SQL Server/100/DTS/binn/Interop.APTFDBReader.EXE. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SQL Server/100/DTS/binn/Interop.APTFDBReader/Interop.APTFDBReader.EXE.

--- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

+1

Interop.APTFDBReader.DLLをC:/ Program Files/Microsoft SQL Server/100/DTS/binn /に手動でコピーした後、問題が修正されます。 これはこの問題を解決する唯一の解決策ですか? Interop.APTFDBReader.DLLをGACにインストールしようとしましたが、厳密な名前が必要でInterop.APTFDBReader.DLLが自動的に生成されます。 –

+0

自動生成されたInterop.MapPointの類似した問題!あなたのコメントで解決されました!ありがとうございました! – michele

答えて

0

TLBIMP.EXEを使用して相互運用機能をビルドの一部として生成し、強力な名前を作成するための引数を与えることができます。

サードパーティのCOMサーバーをベースにしているのであれば、GACにそのinteropをインストールすることをお勧めしますか?

関連する問題