我试图在服务器上托管我的应用。在visual studio中运行它工作正常,当我将它发布到文件夹时,我看到没有错误。
然后我使用Filezilla将文件传输到服务器,当我尝试使用它时,它给了我这个错误。
System.MissingMethodException
Method 'CompilerParameters.get_CoreAssemblyFileName' not found.
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
Exception stack trace:
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.GetCompilationArgume ntString (System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename unknown>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000] in <filename unknown>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000] in <filename unknown>:0
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000] in <filename unknown>:0
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename unknown>:0
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] 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) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.Web.VirtualPath virtualPath, System.Type requiredBaseType) [0x00000] in <filename unknown>:0
at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0
这是我第一次尝试这一点,但我无法弄清楚可能出现的问题。
如果我查看我的web.config文件,它会说:
<compilation debug="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2"/>
哪个是asp版本?
错误页面也给了我这个:
Version Information: 4.0.5 (Stable 4.0.5.1/1d8d582 Thu Nov 12 12:03:50 UTC 2015); ASP.NET Version: 4.0.30319.17020
所以我怀疑它与版本不同有什么关系?但我真的不确定。