c# - IIS服务器找不到index.aspx文件-404错误

标签 c# asp.net iis visual-studio-2015 compiler-errors

我正在使用VS 2015(不是MVC)在asp.net上开发Web应用程序。我选择了“项目”(不是网站)来创建应用程序。该应用程序在我的本地计算机上运行良好。我已经发布了网站(使用按编译的文件系统)并将其上传到服务器空间。现在我得到了流动的错误:

找不到资源。

说明:HTTP404。您正在寻找的资源(或其依赖项之一)可能已被删除,名称更改或暂时不可用。请查看以下网址,并确保其拼写正确。

请求的URL:/Index.aspx

但是index.aspx文件位于根目录下。我不确定为什么IIS找不到index.aspx文件。

web.config文件是否需要任何更改?有什么线索吗?

您可以在http://ssdm.xinksoft.com/找到该站点

谢谢

Partha Sarathi Chakraborty

最佳答案

如果查看错误消息的源代码,则显示以下消息:

<!-- 
[FileNotFoundException]: Could not find file &#39;D:\INETPUB\VHOSTS\xinksoft.com\ssdm.xinksoft.com\bin\roslyn\csc.exe&#39;.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName()
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames)
   at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames)
   at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames)
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
[HttpException]: Exception of type &#39;System.Web.HttpException&#39; was thrown.
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->

因此,缺少D:\INETPUB\VHOSTS\xinksoft.com\ssdm.xinksoft.com\bin\roslyn\csc.exe上的文件。也许您没有复制完整的bin文件夹?

关于c# - IIS服务器找不到index.aspx文件-404错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51787928/

相关文章:

c# - 我如何知道给定的 .NET 程序集面向哪个平台?

c# - 嵌入用户控件是一个坏主意吗?

c# - 远程处理异常 : Object 'xxx.rem' has been disconnected or does not exist at the server

asp.net - 单声道 + mysql = 慢?

asp.net - 从 asp.net 中的数据库表下载 >10,000 行

iis - WebDeploy 不监听端口 8172

c# - 在 UWP C# 中应用高通滤波器

c# - 带有四个 && 的 LINQ Where 子句

ssl - 403 - 禁止访问被拒绝。信息系统

iis - http ://localhost:port always redirecting to https://localhost