ASP.net: Website or web application project

前端 未结 5 981
感动是毒
感动是毒 2020-12-15 00:08

Is there any difference between website and web application project? What if you are working on a project that is sort of hybrid of site and application? which project shoul

相关标签:
5条回答
  • 2020-12-15 00:20

    Take a look:

    http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5 http://forums.asp.net/p/1300026/2538628.aspx

    0 讨论(0)
  • 2020-12-15 00:20

    Refer to the links in the post:

    http://www.codersbarn.com/post/2008/06/01/ASPNET-Web-Site-versus-Web-Application-Project.aspx

    Anthony :-)

    0 讨论(0)
  • 2020-12-15 00:22

    I'm used to create websites when I want to create a new webapplication.

    My current project had some problems on compiling, so I switched to a webapplication project. The step isn't very hard. Visual Studio helps you to change all necessary lines.

    0 讨论(0)
  • 2020-12-15 00:29

    I'ld go the newer Web Application project (always, regardless of the size of the project).

    There is nothing to lose and everything to gain with using the Web Application Project (you cannot say this about using the "website" only).

    The official list of differences are here:

    Use Web Application Projects when you

    1. Need to migrate large Visual Studio.NET 2003 applications
    2. Need to control names of output assemblies
    3. Need stand-alone classes to reference page and user control classes
    4. Need to build a Web application using multiple Web projects
    5. Need to add pre-build and post-build steps during compilation

    Use Websites if you:

    1. Need to generate one assembly for each page.
    2. Prefer single-page code model to code-behind model.
    3. Prefer dynamic compilation and working on pages without building entire site on each page view (that is, save file and then simply refresh the page in the browser).
    4. Want to open and edit any directory as a Web project without creating a project file

    @Mehrdad's link here is essential if you want to know more http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5

    0 讨论(0)
  • 2020-12-15 00:33

    As for which project to choose, I would go with the Web Application Project, regardless of size. Having all of your code behind compile down into a single DLL is a major benefit for maintenance and security on the hosting end. I know there are precompile options for web site projects, but they seemed like more trouble that it was worth for me.

    I know that the IIS filters are in place to prevent users from accessing your .vb or .cs files, but it still makes me a little leery.

    But more important to this is the nice fact that if you make a bunch of coding changes, or maybe add some classes and change the processing logic, the only thing you have to merge up is the compiled DLL and nothing else. Similarly, if you do a few UI changes (say change the stylesheet or position of a few controls), you don't have to worry about recompiling the application, you simply bring over the update .aspx page and you're done.

    0 讨论(0)
提交回复
热议问题