debian 上的单声道:找不到文件“/srv/www/proj/bin\roslyn\csc.exe”
Posted
技术标签:
【中文标题】debian 上的单声道:找不到文件“/srv/www/proj/bin\\roslyn\\csc.exe”【英文标题】:mono on debian: Could not find file "/srv/www/proj/bin\roslyn\csc.exe"debian 上的单声道:找不到文件“/srv/www/proj/bin\roslyn\csc.exe” 【发布时间】:2016-01-13 21:39:09 【问题描述】:我尝试将用 Visual Studio 编写的 ASP NET 4.5 网站部署到 Mono 服务器。
System.IO.FileNotFoundException 找不到文件“/srv/www/proj/bin\roslyn\csc.exe”。
描述:HTTP 500.Error processing request.
System.IO.FileNotFoundException
Could not find file "/srv/www/proj/bin\roslyn\csc.exe".
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) <0x41aaab70 + 0x006e7> in <filename unknown>:0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) <0x41bba470 + 0x00053> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
at System.IO.File.OpenRead (System.String path) <0x41bc4b50 + 0x0003f> in <filename unknown>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName () <0x41e0fb40 + 0x00086> in <filename unknown>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) <0x41e1d600 + 0x005ce> in <filename unknown>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) <0x41e1d460 + 0x000c7> in <filename unknown>:0
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) <0x41e1d2b0 + 0x0004d> in <filename unknown>:0
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) <0x41e0da40 + 0x00991> in <filename unknown>:0
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) <0x41e0da00 + 0x00023> in <filename unknown>:0
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) <0x41e0be60 + 0x009af> in <filename unknown>:0
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) <0x41dc8e90 + 0x00523> in <filename unknown>:0
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) <0x41dc89d0 + 0x0011b> in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) <0x41dc87f0 + 0x00093> in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) <0x41dc87c0 + 0x00017> in <filename unknown>:0
at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetCompiledType (System.String virtualPath) <0x41dc87a0 + 0x00013> in <filename unknown>:0
at System.Web.Mvc.BuildManagerCompiledView.Render (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer) <0x41dc8580 + 0x00055> in <filename unknown>:0
at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context) <0x41dbb2a0 + 0x001ec> in <filename unknown>:0
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) <0x41d3a2f0 + 0x0001d> in <filename unknown>:0
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (IList`1 filters, Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) <0x41dbae00 + 0x0008a> in <filename unknown>:0
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (IList`1 filters, Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) <0x41dbae00 + 0x001bf> in <filename unknown>:0
我做错了什么?
【问题讨论】:
【参考方案1】:最后我设法让它工作了。 对于那些正在寻找类似解决方案的人:
在我的 Apache vHost 配置中我需要添加
MonoSetEnv inventur.netdienste.com MONO_IOMAP=all
该指令将正斜杠转换为反斜杠。
【讨论】:
这也解决了我从 MonoDevelop 运行时的问题。以MONO_IOMAP=all monodevelop
的身份启动它。
我正在开发 OS Sierra,只安装了 VS。我应该把这条线放在哪里?你能解释一下吗?谢谢!【参考方案2】:
我不知道这是否是导致您的问题的原因,但您的路径字符串中有一些不正确的倾斜方向。
是:
"/srv/www/proj/bin/roslyn/csc.exe"
或者:
"\srv\www\proj\bin\roslyn\csc.exe"
【讨论】:
在哪里可以更改此路径设置?没找到, @DanielPomrehn 我只是假设您在源代码中的某个地方输入了错误的字符串,尽管该异常无助于说明在哪里。以上是关于debian 上的单声道:找不到文件“/srv/www/proj/bin\roslyn\csc.exe”的主要内容,如果未能解决你的问题,请参考以下文章
错误:找不到单声道。确保将 Mono 的“/bin”文件夹添加到环境的 PATH 变量中(在 MacOS 上)