ASP.NET Web Site or ASP.NET Web Application?

前端 未结 25 2322
自闭症患者
自闭症患者 2020-11-21 08:26

When I start a new ASP.NET project in Visual Studio, I can create an ASP.NET Web Application or I can create an ASP.NET Web Site.

What is the difference between ASP.

25条回答
  •  独厮守ぢ
    2020-11-21 08:50

    Web applications require more memory, presumably because you have no choice but to compile into a single assembly. I just converted a large legacy site to a web application and have issues with running out of memory, both at compile time with the error message as below :

    Unexpected error writing metadata to file '' -- 
    Not enough storage is available to complete this operation. 
    

    error, and at runtime with this error message as below :

    Exception information: 
        Exception type: HttpException 
        Exception message: Exception of type 'System.OutOfMemoryException' was thrown.
       at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
    

    My recommendation for converting larger sites on memory-constrained legacy hardware is, to choose the option to revert back to the web site model. Even after an initial success problem might creep up later.

提交回复
热议问题