【问题标题】:FSharp site on shared server, which dll's do I need to include in the bin folder?共享服务器上的 FSharp 站点,我需要在 bin 文件夹中包含哪些 dll?
【发布时间】:2009-02-19 11:42:32
【问题描述】:

我需要在 bin 文件夹中包含哪些 dll? 还是我需要自己在服务器上安装 F#?

注: 已解决

  • 所有 FSharp dll 现在都在站点 Bin 中
  • 使用 Visual Studio 中的“发布”选项部署站点
    • 允许预编译站点可更新必须取消选中

来自我的网站的错误:

系统找不到指定的文件

说明:在执行当前网络请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详情:System.ComponentModel.Win32Exception:系统找不到指定的文件

来源错误

在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。

堆栈跟踪

[Win32Exception (0x80004005): The system cannot find the file specified]
   System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) +2097
   System.Diagnostics.Process.Start() +140
   Microsoft.FSharp.Compiler.CodeDom.Internal.Compiler.compileFiles(String args, CompilerResults res) +120
   Microsoft.FSharp.Compiler.CodeDom.Internal.Compiler.compileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames, CompilerResults results, FastFunc`2 sortf) +278
   System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +23
   System.Web.Compilation.AssemblyBuilder.Compile() +843
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +164
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +267
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +582
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93
   System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile) +325
   System.Web.UI.PageParser.EnsureMasterPageFileFromConfigApplied() +89
   System.Web.UI.PageParser.HandlePostParse() +16
   System.Web.UI.TemplateParser.Parse() +155
   System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() +105
   System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +54
   System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +182
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +29
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +267
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +582
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +111
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +54
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161

版本信息:Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433

【问题讨论】:

    标签: asp.net f#


    【解决方案1】:

    如果您使用 aspnet_compiler.exe 工具(或使用 Visual Studio 中的发布按钮)“预编译”网站而不将其编译为“可更新”(这意味着所有 ASPX 和 FS 文件都必须编译成 DLL) ) 那么我想你只需要:

    • FSharp.Core.dll(包含核心 F# 库、列表、元组等)
    • 可能是 FSharp.PowerPack.dll(如 Robert 所述)

    运行时不需要来自 F# 安装的其他 DLL。如果您想在服务器上编译 Web 应用程序(使用 F# CodeDOM)(即将其部署为可更新的网站),那么您需要在服务器上安装 F#,并且您需要生成“fsc”的权限.exe”(所以这看起来不像共享服务器的情况)。

    【讨论】:

      【解决方案2】:

      在服务器上安装 F# 肯定会解决您的问题,但并非绝对必要。您肯定会获得对 FSharp.core.dll 的依赖,如果您从项目中引用了 FSharp.PowerPack.dll,那么您可能还会获得对 FSharp.PowerPack.dll 的依赖,以及您可能会引用的任何其他 FSharp.*.dll有参考。您通常可以使用反射器来查找您的应用程序所依赖的 dll。

      【讨论】:

      • 我已经引用了我引用的两个 dll,但仍然出现奇怪的错误,我可能需要将整个文件复制到我的 bin 目录中......然后删除我不需要的那些?
      【解决方案3】:

      我可以通过取消选中允许此预编译站点可更新并将所有 dll 都放在目录中来解决此问题。

      感谢您的建议。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-11-06
        • 2011-11-04
        • 1970-01-01
        • 1970-01-01
        • 2013-06-07
        • 1970-01-01
        相关资源
        最近更新 更多