Maximizing ASP.NET Real World, Object-Oriented Development [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Maximizing ASP.NET Real World, Object-Oriented Development [Electronic resources] - نسخه متنی

Jeffrey Putz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











Pre-Compiled Deployment


It's usually considered bad form to deploy uncompiled code to your production site. If an attacker was able to gain access to your site, he or she could read the .cs, .vb or .aspx files to see what exactly you're doing, which could lead to even more damage. In other cases, you simply might not want a client poking around and messing with your stuff. Pre-compiling your site addresses these issues.

You can publish your site by clicking Website -> Publish Website… in Visual Studio 2005 to perform pre-compilation. Figure 6.6 shows the simple dialog to perform this action. You can also use the aspnet_ compiler.exe command line tool.

Figure 6.6. The pre-compilation dialog in Visual Studio 2005.

This function does some interesting things to your code. First, in the "published" version of your pages, you can open them up to find that they contain only one line of text: "This is a marker file generated by the precompilation tool, and should not be deleted!" In the /bin folder, you'll find some XML configuration files with a .compiled file extension, and of course you'll also find an actual assembly with some random name. Together, these files function just as your application would have if you had simply copied it all to the server. Remember that your pages would be compiled into assemblies anyway, stored in ASP.NET's temporary files folder. Pre-compilation skips that step.

The benefit of compilation is that any possible compilation errors in your site are found before the site is deployed. The source code, including th151, is not visible to anyone that can view the files. Although this is not generally a big deal, you also won't get that brief delay the first time you access a page while it's compiled.


/ 171