ASP.NET预编译的优点是什么?

发布于 2024-08-16 21:24:43 字数 80 浏览 7 评论 0原文

使用 Aspnet_compiler.exe 代替通过 Visual Studio 进行的传统发布有多有用?那么资源 (resx) 文件又如何呢?

How useful is it to use Aspnet_compiler.exe instead of conventional Publish via Visual Studio? And what about resource (resx) files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

几味少女 2024-08-23 21:24:43

与简单的 xcopy 相比,预编译具有两个主要优点:

  1. 文件系统不会包含 .aspx 文件中的所有代码,并且所有后面的代码都会编译到程序集中。

  2. 服务器启动后首次访问页面时不会出现 ASP.NET 编译延迟。

话说回来,这几天我的预编译知识有点生疏了,上次接触已经是前段时间了。

Precompilation, as opposed to simple xcopy gives you two main advantages:

  1. The filesystem will not have all the code in .aspx files and all the code behind is compiled into an assembly.

  2. There is no ASP.NET compilation delay the first time you visit a page after the server starts up.

Having said that, my precompilation knowledge is a bit rusty these days, last time I touched it was a while back.

烟若柳尘 2024-08-23 21:24:43

通过预编译站点,您的服务器不必在第一次访问时编译站点。您可能已经注意到,第一次查看 ASP.NET 页面时会出现明显的延迟。

此外,您不必发送所有文件,因为代码已经编译。如果您不信任托管您页面的人,这可能会很有用。

By pre compiling the site your server won't have to compile the site on the first visit. You have probably noticed that the first time you view an asp.net page there is a noticeable delay.

In addition you don't have to ship all your files since the code is already compiled. This can be useful if you don't trust whoever is hosting your pages.

美男兮 2024-08-23 21:24:43

Visual Studio 的“发布”功能实际上只是 aspnet_compiler.exe 的一个很好的前端。发布的优点是非常容易执行,其中 aspnet_compiler.exe 需要进行一些调整才能获得您想要的结果。

Visual Studio's "Publish" feature is actually just a nice frontend to aspnet_compiler.exe. Publish has the advantage of being very easy to execute, where aspnet_compiler.exe requires some tweaking to get the results you're after.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文