构建/发布的Visual Studio 2013的ASP.NET Web站点的单页 [英] Build/Publish Single Page of Visual Studio 2013 ASP.NET Web Site

查看:102
本文介绍了构建/发布的Visual Studio 2013的ASP.NET Web站点的单页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作是从Visual Studio 2010中迁移到Visual Studio 2013年ASP.net Web项目。

I'm working on a ASP.net web project that was migrated from Visual Studio 2010 to Visual Studio 2013.

在VS 2010中和dll文件。

In VS 2010 when working on a page and it's respective code-behind you could right click the page in the solution explorer and click "Build/Publish" page and it would compile the aspx and cs into their respective aspx and dll files.

在VS 2013的事情了一下周围移动。现在,您必须构建/发布整个网站。然而,有,如果你右键点击您要发布的页面的选项。然而,它的作用是贴在ASPX和$ C $在您的web_deploy文件夹中的c-后面,当你去它推到生产环境不完全相同工作...所以我的问题是:

In VS 2013 things moved around a bit. You must now Build/Publish the entire web site. There is however an option if you right click the page you want to publish. However, all it does is stick the aspx and the code-behind in your "web_deploy" folder and that doesn't exactly work when you go to push it to your production environment...so my question is:

如何使用的Visual Studio 2013而无需发布整个网站发布单个页面从我的web项目?

推荐答案

发布单一页面。至于我记得...... VS从来没有支持这个...

Publishing a single page is not recommended. As far as I remember ... VS never supported this ...

不兼容组件的风险是非常高的。更新一个页面的HTML只有部分可以工作...但是...再次不推荐......而且是不好的做法

The risk of incompatible assemblies is very high. Updating the HTML only portion of a single page could work ... but again ... not recommended ... and is bad practice

不建议为什么发布的单个页面的原因(也不支持)是因为在每个页面的code编译成一个单独的页面组件。对象引用该页面之外构建过程中被更新。以内置组件,该页面并将其插入到一个Web应用程序并不能保证的联系是一致的。充其量它被认为是未定义的行为。它可以工作,但在生产环境中做这样的做法不好。

The reason why publishing a single page is not recommended (nor supported) is because the code in each page is compiled into a separate page assembly. References to objects outside of that page are updated during the build process. Taking the built assembly for that page and inserting it into a web application does not guarantee that the linkages are consistent. At best it is considered "undefined behavior". It may work, but doing such in a production environment is poor practice.

这篇关于构建/发布的Visual Studio 2013的ASP.NET Web站点的单页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆