1

I am developing a web application on asp.net using VS 2015 (not MVC). I have chosen "Project" (Not website) to create the application. The application is running fine in my Local machine. I have published the website (using File system as per-compiled) and uploaded it to the server space. Now I am getting the flowing Error:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Index.aspx

But the index.aspx file is there under the root. I am not sure why the IIS can't find the index.aspx file.

Is there any change needed in web.config file? Any clue?

You can find the site at http://ssdm.xinksoft.com/

Thanks

Partha Sarathi Chakraborty

Partha
  • 469
  • 2
  • 14
  • 32
  • Have you tried requesting this URL instead: `/Index`? – Rafalon Aug 10 '18 at 13:47
  • @Rafalon you are correct. /index is working. But the user will type the website only without file. How could I resolve this issue... is any change in "settings.AutoRedirectMode" option in RouteConfig file is needed? – Partha Aug 10 '18 at 14:12
  • Possible duplicate of [Publish website without roslyn](https://stackoverflow.com/questions/32282880/publish-website-without-roslyn) – NineBerry Aug 10 '18 at 16:39

2 Answers2

0

In IIS Manager, you can specify the default document of your WebSite, did you declare index.aspx ?

enter image description here

Zysce
  • 1,200
  • 1
  • 10
  • 35
  • Yes. I did. But the problem exists. – Partha Aug 10 '18 at 14:00
  • Like NineBerry asked, did you copy the whole bin folder and is .net runtime installed on the server (same version than the project) ? What verson of ASP.Net are you using ? – Zysce Aug 10 '18 at 14:06
0

If you look into the source code of the error message, there is this message:

<!-- 
[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)
-->

So, the file at D:\INETPUB\VHOSTS\xinksoft.com\ssdm.xinksoft.com\bin\roslyn\csc.exe is missing. Maybe you didn't copy the complete bin folder?

NineBerry
  • 26,306
  • 3
  • 62
  • 93
  • Server provider does not allow .exe file in the bin folder. – Partha Aug 10 '18 at 16:28
  • 1
    You might try the steps at https://stackoverflow.com/questions/32282880/publish-website-without-roslyn or the proposal in https://blogs.msdn.microsoft.com/jpsanders/2018/02/22/error-could-not-find-a-part-of-the-path-esitesroot0binroslyncsc-exe/ – NineBerry Aug 10 '18 at 16:43