your programing

파일 또는 어셈블리 'Antlr3.Runtime (1)'또는 해당 종속성 중 하나를로드 할 수 없습니다.

lovepro 2020. 10. 6. 18:51
반응형

파일 또는 어셈블리 'Antlr3.Runtime (1)'또는 해당 종속성 중 하나를로드 할 수 없습니다.


MVC4프로젝트 를 실행하는 동안이 오류가 발생 했습니다. 다른 컴퓨터에서는 마지막으로 제대로 작동했지만 다른 컴퓨터에서 실행하려고하면이 오류가 발생합니다.

파일 또는 어셈블리 'Antlr3.Runtime (1)'또는 해당 종속성 중 하나를로드 할 수 없습니다. 찾은 어셈블리의 매니페스트 정의가 어셈블리 참조와 일치하지 않습니다. (HRESULT에서 예외 : 0x80131040)

이것에 대해 읽고 나면 여기 내가 시도한 :

설치 패키지 Antlr3.Runtime -Pre

하지만 도움이되지 않았습니다. 어떤 아이디어라도?


무료 Nlog 로깅 플랫폼을 실험 할 때 동일한 문제가 발생했습니다.

이것은 나를 도왔습니다.

파일 탐색기에 % TEMP %를 입력하고 모든 임시 파일을 삭제합니다.

그 후 Visual Studio에서 MVC5 프로젝트를 시작할 때 오류가 발생하지 않았습니다.


다음 중 하나를 수행하여 ASP.Net의 임시 파일을 삭제하십시오.

  • 파일 탐색기에 % TEMP %를 입력하고 모든 임시 파일을 삭제합니다.
  • "C : \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files"폴더로 이동하여 모든 파일을 삭제합니다.

.NET에서 임시 ASP.NET 파일도 지우는 것을 잊지 마십시오 Framework64. 그것은 나를위한 속임수였습니다.

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files

누군가에게 도움이 될 경우를 대비하여.
MVC 5 응용 프로그램에서이 문제가 발생했습니다. bin 디렉토리 에서 Antlr3.Runtime.dll삭제 하고 다시 빌드하면 문제가 해결되었습니다.


내 문제는 WebGrease의 최신 버전이 Antlr 3.4.1.9004 버전을 설치한다는 것입니다. WebGrease를 설치하고 Antlr을 버전 3.5.0.2로 업데이트하면 오류가 사라졌습니다.


문제를 해결하는 솔루션이 있으면 어셈블리 버전 인 web.config를 확인하십시오.

<dependentAssembly>
        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
      </dependentAssembly>

나를 위해 web.config 파일에서이 노드를 제거하면 오류 메시지가 제거되었습니다.

<identity impersonate="true" userName="" password="">

하지만 정말 효과가 있었던 것은 C : \ Windows \ Microsoft.NET \ Framework {version} (또는 Framework64)에있는 Temporary ASP.NET Files "폴더에 대한 전체 액세스 권한 (impersonate에 지정된 userName에 대한)을 부여하는 것입니다.

이 ID는 IIS의 웹 사이트 응용 프로그램 풀 설정에도 저장 될 수 있습니다.

너겟 패키지가 올바른 버전으로 올바르게 설치되었는지 확인하십시오. 아무것도 작동하지 않으면 로컬 폴더에서 참조를 다시 추가하고 로컬 복사로 설정하십시오.


간단한 방법 중 하나는 antlr 및 webgrease를 업데이트하는 것입니다.

  1. Goto 패키지 콘솔 관리자
  2. 그런 다음이 코드를 하나씩 적용하십시오.
  3. PM> 업데이트 패키지 Antlr
  4. PM> 업데이트 패키지 WebGrease

마지막으로 오류 해결


나에게 이것은 Antlr의 디버그 버전과 런타임 버전 간의 불일치로 인해 발생했습니다.

마지막으로 다른 Antlr 패키지를 설치하여 해결했습니다. Install-Package Antlr


참조를 수동으로 추가하는 경우 Antlr3.Runtime.dll의 잠금을 해제하십시오. 여기에 이미지 설명 입력


web.config에서 impersonate = "true"에 문제가 발생했습니다. 작동하는 줄을 제거했습니다!

다시 한 번 줄을 배치하고 가장을 사용하여 계정 사용자에게 관리자 권한을 부여했으며 전체 응용 프로그램이 작동했습니다. :)


가장을 사용하는 경우. 대답은 다음 폴더에 대한 액세스를 가장하는 사용자에게 권한을 부여하는 것입니다.

  1. C:\Windows\Microsoft.NET\Framework[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files

  2. 귀하의 사이트 디렉토리.

또한 다음과 같이 폴더를 만들어야 할 수도 있습니다.

C:\Windows\Microsoft.NET\Framework\[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files\[Application-Name-Goes-Here]

그러나 이전을 먼저 시도해보십시오.

Those two changes for granting the impersonated user permission to be able to save the temp data, and pull the dll files, and any needed files from the directories

Update, For windows 10 This is the solution that worked for me

We will do both steps, but Instead of C:\Windows\Microsoft.NET\Framework[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files

Write %TEMP% into the file explorer, and give permission for the user that you're impersonating access to the following folder: C:\Users\[UserName]\AppData\Local\Temp\Temporary ASP.NET Files


In a project I had reference to WebGrease, but there was not corresponding element in packages.config. I remove the reference from project, because I don't need it anymore. It works now.


I tried all of the answers in this post, but none of them worked for me.

So I deleted all of the /bin directories inside all of the projects from my solution, cleaned and rebuilt the solution and it finally worked!

My whole morning wasted working to figure out the problem...


what worked for me was removing the identity = true from my webconfig (under the system.web properties) and build the solution again and publish it again (if needed) and it worked like a charm!


My problem ended up being caused by a change to the mapped drives in our Group Policy. My solution has the tempDirectory setting set in the Web.config to use a RAM drive setup as my Z: drive. Apparently they started using the Z: drive and the DLLs were getting copied to tempDirectory like normal, but then I think they were being deleted by a process on the remote server (Virus scan probably). I was only able to figure this out by using Process Monitor and filtering for Antlr and seeing that it was looking in a network location for the DLLs.


I updated all packages in the Nudget Package Manager and it worked! In my case I'm hosting my website in GoDaddy


After trying to delete .netframework temp file without success, I changed

<system.web>
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime />
    <pages controlRenderingCompatibilityVersion="4.0" />
</system.web> 

With only targetFramework="4.6" instead of 4.6.1 Web site displays without errors. Next I changed again to targetFramework="4.6.1" and restart server. Everything remains Ok.


For me, the solution was to run Visual Studio as Administrator. It was apparently a permissions issue.


Solution for me was to go Tools > NuGet Package Manager > Manage Packages for Solution

Then click Antlr3 and ensure it was installed in:

  1. The Startup Project
  2. Any libraries using reflection
  3. Any libraries calling the libraries that use reflection

제 경우에는 4 개의 프로젝트가 필요했습니다. 그 후이 문제는 마침내 해결되었습니다.


나는 방금이 문제에 직면하고 위에서 언급 한 해결책을 시도했지만 지금은 아무것도 효과가 없었지만 bin floder에서 dll을 삭제하고 다시 빌드 한 다음 패키지 폴더에서 모든 관련 파일을 삭제하고 패키지 관리자 콘솔을 사용하여 패키지를 복원해야했습니다.


% temp % 삭제

휴지통 삭제

.vs 삭제

이제 나를 위해 일했습니다.


필자의 경우 프로젝트를 복제 할 때 Visual Studio 2019는 프로젝트 경로에서 공백 문자를 '% 20'으로 대체했습니다. 그런 다음 VS가 너깃 패키지를 찾으려고 할 때 올바른 경로를 찾을 수 없습니다.

참고 URL : https://stackoverflow.com/questions/20180634/could-not-load-file-or-assembly-antlr3-runtime-1-or-one-of-its-dependencies

반응형