November 1, 2013 at 2:19 pm
My setup - .NET 3.5 and Visual Studio 2008. I have c# code (inside ssis, but don't worry about ssis). I wanted to be able to use ADODB in my code. So, I added a reference to ADODB. I selected Microsoft ActiveX Data Objects 2.8 Library from the COM tab. Then, I added using ADODB as my import.
The sample steps are here -
http://www.c-sharpcorner.com/uploadfile/ptailor/adodbservice12062005002501am/adodbservice.aspx
But, after running the project, I get an error and I also see that the reference is missing form the list of references. I swear it was there after I added it. How do I fix this problem ?
error-
System.IO.FileNotFoundException: Could not load file or assembly 'Interop.ADODB, Version=2.8.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Interop.ADODB, Version=2.8.0.0, Culture=neutral, PublicKeyToken=null'
at ST_39348fjejencuw92092828303554.csproj.ScriptMain.Main()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& 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 Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
Also posted at the great StackOverflow.com -
http://stackoverflow.com/questions/19732278/cannot-add-a-reference-to-c-sharp-code
Viewing post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply