2013-11-29 3 views
1

폴더를 탐색 할 수있는 웹 페이지를 만들려고합니다. 나는 별도의 솔루션이 일을하고 모든 작품,하지만 난 또한 PostSharp를 참조하는 두 개 이상의 프로젝트와 솔루션에 통합하려고 할 때이 오류 얻을 수있다 :System.IO.FileNotFoundException : 파일 또는 어셈블리를로드 할 수 없습니다. 시스템에서 SharpSvn.dll 파일을 찾을 수 없습니다.

Unhandled exception (2.1.7.1, 32 bit, CLR 4.0, Release): System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\_projects\...\Libraries\SharpSvn\SharpSvn.dll' or one of its dependencies. The system cannot find the file specified. 
    File name: 'file:///C:\_projects\...\Libraries\SharpSvn\SharpSvn.dll' 

     at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
     at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
     at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) 
     at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) 
     at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile) 
     at PostSharp.Sdk.CodeModel.ModuleDeclaration.GetSystemModule() 
     at PostSharp.Sdk.CodeModel.Domain.LoadAssembly(Assembly reflectionAssembly, Boolean lazyLoading) 
     at PostSharp.Sdk.CodeModel.Domain.GetAssembly(IAssemblyName assemblyName, BindingOptions bindingOptions) 
     at PostSharp.Sdk.CodeModel.AssemblyRefDeclaration.GetAssemblyEnvelope() 
     at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^SgrhoGlQ(AssemblyRefDeclaration _0) 
     at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^+GwnKh4ZYHu3() 
     at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.Execute() 
     at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase) 
     at PostSharp.Sdk.Extensibility.Project.Execute() 
     at PostSharp.Hosting.PostSharpObject.ExecuteProjects() 
     at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) 

    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]. 
+0

오류가 없어 방법이 언급 때 정적 무효 SVN_SSL_Override (객체 송신자 SharpSvn.Security.SvnSslServerTrustEventArgs E)를 { e.AcceptedFailures = e.Failures; e.Save = true; } –

+0

두 프로젝트의 대상 플랫폼이 같은지 확인 했습니까? –

+2

참조중인 PostSharp의 버전이 모든 프로젝트에서 동일해야합니다. – ohiodoug

답변

0

나는 썼다 : "나는이 오류가 사라 방법을 언급 할 때 : 정적 무효 SVN_SSL_Override (개체를 보낸 사람, SharpSvn.Security.SvnSslServerTrustEventArgs 전자) {e.AcceptedFailures = e.Failures, e.Save이 = TRUE;}"

이유를 모르겠지만 문제가있어서 제거했습니다.

client.Authentication.Clear(); client.Authentication.SslServerTrustHandlers + = 새 EventHandler (SVN_SSL_Override); client.Authentication.DefaultCredentials = new NetworkCredential ("", "");

이 방법

정적 무효 SVN_SSL_Override (객체 송신자 SharpSvn.Security.SvnSslServerTrustEventArgs E) = {e.AcceptedFailures e.Failures; e.Save = true; } "

단지 덧붙여

client.Authentication.UserNamePasswordHandlers + = 대리자 (오브젝트 OBJ, SharpSvn.Security.SvnUserNamePasswordEventArgs에 args) { args.UserName =""; args.Password = ""; 사실 args.Save =; };

지금은 작동합니다.

제가
0

그것은 SharpSVN 조립이있을 가능성을 두 개의 기본 DLL (32 비트 버전의 경우 SharpSvn-DB44-20-win32.dllSharpSvn-Sasl21-23-win32.dll)을 참조하기 때문에로드에 실패했습니다. 그것들이 시스템 검색 경로의 어딘가에 없다면 (일반적으로 ASP.NET의 경우) SharpSVN은 아마도로드에 실패 할 것입니다.

네이티브 DLL이로드되지 않았기 때문에 내 NuGet 패키지 중 하나가 MVC 웹 사이트에서 작동하지 않는 similar problem이 있습니다. bin 폴더가 검색 경로에 없거나 응용 프로그램 폴더에 있지 않기 때문에 웹 사이트의 bin 폴더에 넣는 것만으로는 충분하지 않았습니다.

시도 Global.asax.cs 파일에서 응용 프로그램 클래스에 다음 메서드를 추가하고 Application_Start()에서 호출 :

public static void CheckAddBinPath() 
{ 
    // find path to 'bin' folder 
    var binPath = Path.Combine(new string[] { AppDomain.CurrentDomain.BaseDirectory, "bin" }); 
    // get current search path from environment 
    var path = Environment.GetEnvironmentVariable("PATH") ?? ""; 

    // add 'bin' folder to search path if not already present 
    if (!path.Split(Path.PathSeparator).Contains(binPath, StringComparer.CurrentCultureIgnoreCase)) 
    { 
     path = string.Join(Path.PathSeparator.ToString(), new string[] { path, binPath }); 
     Environment.SetEnvironmentVariable("PATH", path); 
    } 
} 

이에 SharpSvn을 허용해야 만 응용 프로그램에 대한 시스템 검색 경로에 bin 폴더를 추가합니다 의존하고있는 네이티브 DLL을 찾습니다. 파일이 실제로 있는지 확인하십시오. 그렇지 않은 경우 SharpSvn 배포본에서 복사해야 할 수도 있습니다.

물론 나는 완전히 벗어날 수 있습니다. 내가 어느 쪽이든 알려주지.

+0

이 시도하고 결과를 알려드립니다. –

+0

아니요, 여전히 같은 오류입니다. 그러나 도움을 청하기 위해 –

관련 문제