System.IO.FileNotFoundException: Could not load file or assembly 'X' or one of its dependencies when deploying the application

前端 未结 4 428
既然无缘
既然无缘 2020-11-30 09:39

I\'m having a strange problem with deploying an application, which references an assembly, written in managed c++.

I\'ve created an assembly X, compiled it and refer

相关标签:
4条回答
  • 2020-11-30 10:03

    I had the same issue. For me it helped to remove the .vs directory in the project folder.

    0 讨论(0)
  • 2020-11-30 10:03

    I also had the same issue when I tried to install a Windows service, in my case I managed to resolved the issue by removing blank spaces in the folder path to the service .exe, below is the command worked for me in a command prompt

    cd C:\Windows\Microsoft.NET\Framework\v4.0.30319

    Press ENTER to change working directory

    InstallUtil.exe C:\MyService\Release\ReminderService.exe

    Press ENTER

    0 讨论(0)
  • 2020-11-30 10:22

    ... Could not load file or assembly 'X' or one of its dependencies ...

    Most likely it fails to load another dependency.

    you could try to check the dependencies with a dependency walker.

    I.e: https://www.dependencywalker.com/

    Also check your build configuration (x86 / 64)

    Edit: I also had this problem once when I was copying dlls in zip from a "untrusted" network share. The file was locked by Windows and the FileNotFoundException was raised.

    See here: Detected DLLs that are from the internet and "blocked" by CASPOL

    0 讨论(0)
  • 2020-11-30 10:26

    I resolved this problem by renaming the DLL. The DLL had been manually renamed when it was uploaded to its shared location (a version number was appended to the file name). Removing the version number from the downloaded file resolved the issue.

    0 讨论(0)
提交回复
热议问题