2013-03-20 6 views
1

서버에서 실행중인 VB 프로그램에서 .Net 어셈블리에 액세스하려고합니다. 자주 언급 된 Could not load file or assembly 오류가 나타납니다. 저는 약 60 개의 서로 다른 웹 페이지를 훑어 보았습니다..Net 어셈블리를로드 할 수 없습니다.

저는 실행 파일과 동일한 디렉토리에 dll을 가지고 있습니다. Appbase에서는 file://?/c:을 보여주고 있으며 다른 예제에서는 이것을 연구 해 보았습니다. 그들은 모두 file:///이었습니다. 그게 문제가 될 수 있는지 아닌지 나는 모른다. 그렇다면 누구나 해결 방법을 알려 줄 수 있습니까? file://?/에 대한 검색을 시도했지만 Google 및 Bing의 물음표로 묶인 경우에도 모든 특수 문자를 무시합니다.

오류 메시지 :

Unhandled Exception: System.TypeInitializationException: The type initializer for 'cgiTest.modCurrentBalance' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. The system cannot find the file specified. 
File name: 'Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' 
    at cgiTest.modCurrentBalance..cctor() 

=== Pre-bind state information === 
LOG: User = WEBSERVER1\Administrator 
LOG: DisplayName = Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56 
(Fully-specified) 
LOG: Appbase = file://?/c:/inetpub/intranet/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : cgiTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abaf442583423e6f. 
=== 
LOG: This bind starts in default load context. 
LOG: No application configuration file found. 
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. 
LOG: Post-policy reference: Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56 
LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells.DLL. 
LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells/Aspose.Cells.DLL. 
LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells.EXE. 
LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells/Aspose.Cells.EXE. 

    --- End of inner exception stack trace --- 
    at cgiTest.modCurrentBalance.GenerateReport() 
    at cgiTest.Module1.ProcessFunction() in q:\visual studio 2010\Projects\cgiTest\cgiTest\Module1.vb:line 65 
    at cgiTest.Module1.Main() in q:\visual studio 2010\Projects\cgiTest\cgiTest\Module1.vb:line 41 
+3

음 *가 *'Aspose.Cells.dll'입니까? –

+0

그것은 C : C의 \을 Inetpub \ 인트라넷 –

+0

디렉토리 : \를 Inetpub \ 인트라넷 2013년 2월 25일 오후 10시 2분 7,172,952 Aspose.Cells.dll 1 개 파일 (들) 7,172,952 바이트 –

답변

1

http://support.microsoft.com/kb/837908에 설명 된 이벤트 처리기를 사용하여 마침내이 작업을로드 할 수있었습니다.

이 시점에서 왜 내가이 경로를 사용해야하는지 확신 할 수 없지만 기본 동작이어야하는 경로와 바이너리와 dll이있는 경로를 지정하고 있습니다.

내가 알아낼 수있는 유일한 점은 파일 경로 "file : //? /"에있는 물음표와 관련이 있다는 것입니다. 여기서 dll을 찾고 있는데 어디에서 물음표 거기에있다.

1

합니까 프로그램이 파일과 폴더에 액세스 할 수있는 권한이 실행되는 사용자? 파일이 복사되지 않고 다른 ACL이있는 폴더에서 옮겨져 코드에 액세스 할 수없는 경우 일 수 있습니다. 왜 - 확인

가장 좋은 방법은, Process Monitor을받을 만 "Aspose.Cells"를 포함하는 경로에 대한 액세스를 보여 자사의 필터를 구성, 그리고 그들이 실패 할 경우, 파일에 액세스하려고 어떤 프로세스 참조 그렇다면 것입니다.

0

DLL이 응용 프로그램의 BIN 폴더 안에 있으면 안됩니까? 앱이 컴파일되면 어셈블리가 있는지 살펴볼 것입니다.

+0

DLL은 응용 프로그램이있는 BIN 폴더에 있습니다. –

+0

죄송합니다. '실행 파일과 동일한 디렉터리에 DLL이 있습니다.'나는 오해하고 있습니다. 시도해 보셨습니까? server.mappath ("c :/inetpub/intranet /") –

관련 문제