Asp.net 共享服务器上的FSharp站点,其中包含dll';我需要在bin文件夹中包含哪些内容?

Asp.net 共享服务器上的FSharp站点,其中包含dll';我需要在bin文件夹中包含哪些内容?,asp.net,f#,Asp.net,F#,我需要在bin文件夹中包含哪些dll? 或者我需要自己在服务器上安装F#吗 注: 已解决 所有FSharp DLL现在都位于站点Bin中 使用Visual Studio中的“发布”选项部署站点 允许预编译站点可更新必须取消选中 “我的网站”中的错误: 系统找不到指定的文件 说明:执行当前web请求期间发生未经处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源 异常详细信息:System.ComponentModel.Win32Exception:系统找不到指定的文件

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

注: 已解决

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

系统找不到指定的文件

说明:执行当前web请求期间发生未经处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源

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

源错误

[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
在执行当前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

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

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

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

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

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


谢谢你的建议。

我引用了我引用的两个DLL,但仍然出现奇怪的错误,我可能不得不将全部内容复制到我的bin目录中。。然后移除那些我不需要的?