简体   繁体   中英

Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified

I was trying to launch my web application to server,

Server : Vindows Server 2008 R2 Enterprise
IIS version : 7.5
Framework version : 4.0.30319.17929

But the following error appears:

Server Error in '/salavirtual' Application.

Could not load file or assembly 'ServiceStack' or one of its dependencies.   
The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'ServiceStack' could not be loaded.


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

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified.]
 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
 System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +39
 System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +62
 System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
 System.Web.Handlers.AssemblyResourceLoader.EnsureHandlerExistenceChecked() +397    
 System.Web.Handlers.AssemblyResourceLoader.IsValidWebResourceRequest(HttpContext context) +12
 System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +158
 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

Sounds like you have .dll/NuGet packages dependency issue.

I'd do a clean build, close VS.NET, delete /packages folder, than re-open VS.NET and rebuild solution to restore all packages. After check /packages folder to make sure all ServiceStack packages have the same version eg v4.0.46. If not, upgrade all projects to make sure they reference the same NuGet version.

Thanks for your information and quick reply.

Following your answer, I did this steps:

  1. I opened, Tools-->NuGet Package Manager --> Package Manager Console
  2. I selected the project to publish.
  3. I've executed, Uninstall-Package ServiceStack
  4. Then, I've executed Install-Package ServiceStack -Version 3.9.71
  5. Then, when I published the project everything works perfect.

Many thanks for your help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question Could not load file or assembly "path" or one of its dependencies. The system cannot find the file specified XamlParseException: Could not load file or assembly 'ResourceLibrary, …' or one of its dependencies. The system cannot find the file specified Could not load file or assembly or one of its dependencies. The system cannot find the file specified Could not load file or assembly 'Extensions' or one of its dependencies. The system cannot find the file specified Could not load file or assembly 'Ajax' or one of its dependencies. The system cannot find the file specified A specific: Could not load file or assembly 'xxxx' or one of its dependencies. The system cannot find the file specified Could not load file or assembly 'XXX' or one of its dependencies. The system cannot find the file specified Could not load file or assembly 'coba4' or one of its dependencies. The system cannot find the file specified Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed) Could not load file or assembly 'Logging.SNLLoggingStandard3' or one of its dependencies. The system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM