servicestack,C#,Asp.net,servicestack" /> servicestack,C#,Asp.net,servicestack" />

C# 无法加载文件或程序集';ServiceStack';或者它的一个依赖项。系统找不到指定的文件

C# 无法加载文件或程序集';ServiceStack';或者它的一个依赖项。系统找不到指定的文件,c#,asp.net,servicestack,C#,Asp.net,servicestack,我试图将我的web应用程序启动到服务器 服务器:Vindows服务器2008 R2企业版 IIS版本:7.5 框架版本: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.

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

服务器:Vindows服务器2008 R2企业版
IIS版本:7.5
框架版本: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包依赖性问题


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

感谢您提供的信息和快速回复

根据您的回答,我完成了以下步骤:

  • 我打开了,工具-->NuGet软件包管理器-->软件包管理器控制台
  • 我选择了要发布的项目
  • 我已执行,卸载包ServiceStack
  • 然后,我执行了安装包ServiceStack-版本3.9.71
  • 然后,当我发布这个项目时,一切都很完美

  • 非常感谢您的帮助

    Hi mythz,感谢您的信息和快速回复。按照你的回答,我做了以下步骤:1。我打开了,工具-->NuGet软件包管理器-->软件包管理器控制台2。我选择了要发布的项目。3.我已经执行了安装包ServiceStack-版本3.9.71 4。然后,当我发布这个项目时,一切都很完美。非常感谢你的帮助