【发布时间】:2013-08-05 21:56:49
【问题描述】:
当我尝试在 appharbor 中运行 WCF 服务时出现以下错误。我在本地机器上使用 .NET Framework 4 并且它工作正常。我在 appharbor 中禁用了预编译,以便在部署期间不会产生任何错误。因此,构建成功部署,没有任何错误。
“/”应用程序中的服务器错误。
无法加载文件或程序集“TnPServiceAH”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时构建,无法加载。
说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.BadImageFormatException:无法加载文件或程序集“TnPServiceAH”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时构建,无法加载。
来源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常来源和位置的信息。
程序集加载跟踪:以下信息有助于确定程序集“TnPServiceAH”无法加载的原因。
警告:程序集绑定日志记录已关闭。 要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) 设置为 1。 注意:有一些与程序集绑定失败日志相关的性能损失。 要关闭此功能,请删除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
堆栈跟踪:
[BadImageFormatException:无法加载文件或程序集“TnPServiceAH”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时构建,无法加载。] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +48 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, 证据 assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection) +278 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection) +145 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException:无法加载文件或程序集“TnPServiceAH”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时构建,无法加载。] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +590 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +193 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +45 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +164 System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +51 System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +187 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +648 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +305 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext 上下文,VirtualPath virtualPath,布尔 noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)+99 System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext 上下文,VirtualPath virtualPath,布尔 noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)+75 System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +28 System.ServiceModel.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) +135 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +26 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +43 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +495
[ServiceActivationException:服务'/TnPServiceAH.svc'由于编译过程中的异常而无法激活。异常消息是:无法加载文件或程序集“TnPServiceAH”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时构建,无法加载..] System.ServiceModel.AsyncResult.End(IAsyncResult 结果) +394 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult 结果) +196 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication 上下文,布尔流上下文)+216 System.ServiceModel.Activation.HttpModule.ProcessRequest(对象发送者,EventArgs e)+271 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +168
版本信息:Microsoft .NET Framework 版本:2.0.50727.5472; ASP.NET 版本:2.0.50727.5471
【问题讨论】:
-
App Harbor 有支持论坛,看起来这个更适合那里。
-
@oleksii:该网站表示,可以在此处发布在 App Harbor 类型的问题中运行应用程序的一般问题,以便更快、更准确地回复。让我也将其发布在支持论坛中。谢谢。
标签: c# .net wcf c#-4.0 appharbor