OpenPop.NET을 사용하여 Gmail 계정에 액세스하려고 시도하지만 기본 테스트 코드로도 아래 오류 메시지가 표시됩니다. 내가 .NET 프레임 워크 3.5 4. OpenPop DLL을 모두 그것을 참조하는 스크립트 작업과 함께 윈도우 7 시스템에서 SQL Server 비즈니스 인텔리전스 개발 Studio 2008의 SSIS 패키지에서이 작업을 수행하려고C# : 'OpenPop, Version = 2.0.4.369, Culture = neutral, PublicKeyToken = null'또는 해당 종속성 중 하나를로드 할 수 없습니다.
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' at ST_1694f4bcdf2a4068ae871201a2216457.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()
3.5에 내장되고있다. 나는 이것을 며칠 동안 연구했지만 그것을 고칠 수있는 것을 찾을 수 없었다. 원본에서 OpenPop dll을 다시 컴파일하고 여러 번 참조를 제거하고 다시 추가하려고했습니다.
나는 현재 아래 게시 함께 일하고 코드 :
Pop3Client client = new Pop3Client();
try
{
client.Connect("pop.gmail.com", 995, true);
try
{
client.Authenticate("[email protected]", "mypassword");
Console.WriteLine("Success");
client.Disconnect();
}
catch
{
Console.WriteLine("Failed to authenticate");
Dts.TaskResult = (int)ScriptResults.Failure;
return;
}
}
catch
{
Console.WriteLine("Failed to connect");
Dts.TaskResult = (int)ScriptResults.Failure;
return;
}
Dts.TaskResult = (int)ScriptResults.Success;
미리 감사드립니다.
참고 : \ Gacutil.exe를 단지 개발을위한 프로덕션 어셈블리를 전역 어셈블리 캐시에 설치하는 데 사용해서는 안됩니다. – toha