我是否可以/应该将VS2008“网站”转换为“项目”?

时间:2021-05-21 15:01:23

I created a Web site in VS2008. I'm wondering if I should have created it as a project instead and, if so, can it be converted? Any advantages/disadvantages to either approach?

我在VS2008创建了一个网站。我想知道我是否应该将它创建为一个项目,如果是,它可以被转换吗?这两种方法有什么优点或缺点吗?

TIA

蒂雅

2 个解决方案

#1


2  

This may sound a bit obvious, but I think it's something that is misunderstood because VS2005 only shipped with the web site originally. If your project deals with a website that is fairly limited and doesn't have a lot of logical or physical separation, the website is fine. However if it is truly a web application with different modules where many users add and update data, you are better off with the web application.

这听起来可能有点明显,但我认为这是被误解的,因为VS2005最初只是随web站点一起发布的。如果你的项目处理的网站是相当有限的,没有很多逻辑或物理分离,网站是好的。但是,如果它确实是一个具有不同模块的web应用程序,其中有许多用户添加和更新数据,那么最好使用web应用程序。

The biggest pro of the website model is that anything in the app_code section is dynamically compiled. You can make cs file updates without a full redeploy. However this comes at a great sacrifice. A lot of things happen under the covers that are difficult to control. Namespaces are difficult to control and specific dll usage goes out the window by default for anything under app_code since everything is dynamically compiled.

网站模型最大的优点是app_code部分中的任何内容都是动态编译的。您可以在不完全重新部署的情况下使cs文件更新。然而,这是一个巨大的牺牲。很多事情都是在难以控制的范围内发生的。名称空间很难控制,因为所有内容都是动态编译的,所以默认情况下,对于app_code下的任何内容,特定的dll使用都会从窗口中消失。

The web application model does not have dynamic compilation, but you gain control over the things that I have mentioned.

web应用程序模型没有动态编译,但是您可以控制我提到的内容。

If you are doing nTier development, I highly recommend the web application model. If you are doing a limited web site or a quick and dirty implementation, the web site model make have advantages.

如果您正在进行nTier开发,我强烈推荐web应用程序模型。如果您正在做的是一个有限的web站点或一个快速而肮脏的实现,那么web站点模型将具有优势。

More detailed analysis can be found here:
http://west-wind.com/weblog/posts/5601.aspx
http://blogs.vertigo.com/personal/swarren/Blog/Lists/Posts/Post.aspx?ID=10

更详细的分析可以在这里找到:http://west-wind.com/weblog/posts/5601.aspx http://blogs.vertigo.com/personal/swarren/blog/blog/lists/posts/aspx? id =10

#2


0  

There's some information on an old blog post of mine about the differences between the Web Site and Web Application project - http://www.aaron-powell.com/blog.aspx?id=1126

在我以前的一篇博客文章中,有一些关于Web站点和Web应用程序项目之间的差异的信息——http://www.aaron-powell.com/blog.aspx?id=1126

Personally i always use/ convert existing projects to Web Applications as I find them a lot more powerful and configuravle.

就我个人而言,我总是使用/转换现有项目到Web应用程序,因为我发现它们更强大、更可配置。

#1


2  

This may sound a bit obvious, but I think it's something that is misunderstood because VS2005 only shipped with the web site originally. If your project deals with a website that is fairly limited and doesn't have a lot of logical or physical separation, the website is fine. However if it is truly a web application with different modules where many users add and update data, you are better off with the web application.

这听起来可能有点明显,但我认为这是被误解的,因为VS2005最初只是随web站点一起发布的。如果你的项目处理的网站是相当有限的,没有很多逻辑或物理分离,网站是好的。但是,如果它确实是一个具有不同模块的web应用程序,其中有许多用户添加和更新数据,那么最好使用web应用程序。

The biggest pro of the website model is that anything in the app_code section is dynamically compiled. You can make cs file updates without a full redeploy. However this comes at a great sacrifice. A lot of things happen under the covers that are difficult to control. Namespaces are difficult to control and specific dll usage goes out the window by default for anything under app_code since everything is dynamically compiled.

网站模型最大的优点是app_code部分中的任何内容都是动态编译的。您可以在不完全重新部署的情况下使cs文件更新。然而,这是一个巨大的牺牲。很多事情都是在难以控制的范围内发生的。名称空间很难控制,因为所有内容都是动态编译的,所以默认情况下,对于app_code下的任何内容,特定的dll使用都会从窗口中消失。

The web application model does not have dynamic compilation, but you gain control over the things that I have mentioned.

web应用程序模型没有动态编译,但是您可以控制我提到的内容。

If you are doing nTier development, I highly recommend the web application model. If you are doing a limited web site or a quick and dirty implementation, the web site model make have advantages.

如果您正在进行nTier开发,我强烈推荐web应用程序模型。如果您正在做的是一个有限的web站点或一个快速而肮脏的实现,那么web站点模型将具有优势。

More detailed analysis can be found here:
http://west-wind.com/weblog/posts/5601.aspx
http://blogs.vertigo.com/personal/swarren/Blog/Lists/Posts/Post.aspx?ID=10

更详细的分析可以在这里找到:http://west-wind.com/weblog/posts/5601.aspx http://blogs.vertigo.com/personal/swarren/blog/blog/lists/posts/aspx? id =10

#2


0  

There's some information on an old blog post of mine about the differences between the Web Site and Web Application project - http://www.aaron-powell.com/blog.aspx?id=1126

在我以前的一篇博客文章中,有一些关于Web站点和Web应用程序项目之间的差异的信息——http://www.aaron-powell.com/blog.aspx?id=1126

Personally i always use/ convert existing projects to Web Applications as I find them a lot more powerful and configuravle.

就我个人而言,我总是使用/转换现有项目到Web应用程序,因为我发现它们更强大、更可配置。