无法加载文件或程序集“ServiceStack"或其依赖项之一.该系统找不到指定的文件 [英] Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified

查看:57
本文介绍了无法加载文件或程序集“ServiceStack"或其依赖项之一.该系统找不到指定的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将我的 Web 应用程序启动到服务器,

I was trying to launch my web application to server,

服务器:Vindows Server 2008 R2 Enterprise
IIS 版本:7.5
框架版本:4.0.30319.17929

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

但是出现如下错误:

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

推荐答案

听起来您有 .dll/NuGet 包依赖性问题.

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

我会做一个干净的构建,关闭 VS.NET,删除 /packages 文件夹,然后重新打开 VS.NET 并重建解决方案以恢复所有包.检查 /packages 文件夹以确保所有 ServiceStack 包具有相同的版本后,例如v4.0.46.如果不是,请升级所有项目以确保它们引用相同的 NuGet 版本.

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 e.g. v4.0.46. If not, upgrade all projects to make sure they reference the same NuGet version.

这篇关于无法加载文件或程序集“ServiceStack"或其依赖项之一.该系统找不到指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆