To dll or not to dll...

I have been using the vwd express up until recently I downloaded 90 day trial of vs 2005 prof.

Been practicing with various things with just 5 page site, updating by merely ftp-ing files to the server.

Upon using VS 2005, I noticed I could create a dll in a '/bin' folder by selecting to 'publish site' (or something similar, don't remember off-hand).  Is there advantage to doing this (with a larger site, of course) and have I been doing this wrong all along?

 

TIA 


Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе.
0
ksasp
2/20/2007 3:36:59 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

7 Replies
1742 Views

Similar Articles

[PageSpeed] 28

Two advantages (that I'm aware of):

You don't have to put your source code on the server.

The first person to access the site, after new source code deployment, doesn't have to wait for it to be compiled.


Steve Wellens

My blog
0
SGWellens
2/20/2007 8:03:20 PM

SGWellens is correct.  But also, once the ASP.NET worker process on the server has idled long enough to shutdown, the first request after that will also not have to wait for it to be compiled.

I typically choose to publish with updateable, single-paged assemblies.  These options can be found in the Publish Web Site dialog.

Hope this helps.


Josh Stodola ← Come check out my blog!
0
JoshStodola
2/20/2007 8:38:04 PM
SGWellens:

Two advantages (that I'm aware of):

You don't have to put your source code on the server.

The first person to access the site, after new source code deployment, doesn't have to wait for it to be compiled.

I would not have to put, for example a '*.cs' file? Only 'default.aspx', 'something_else.aspx' ... ?

And a dll into '/bin'....? 


Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе.
0
ksasp
2/20/2007 9:26:15 PM

Affirmative. 

More info from the online help:

You can precompile for deployment in two ways: precompiling for deployment only, or precompiling for deployment and update.

Precompiling for Deployment Only

When you precompile for deployment only, the compiler produces assemblies from virtually all ASP.NET source files that are normally compiled at run time. This includes program code in pages, .cs and .vb class files, other code files, and resource files. The compiler removes all source and markup from the output. In the resulting layout, compiled files are generated for each of the .aspx files (with the extension .compiled) that contain pointers to the appropriate assembly for that page.

To change the Web site, including the layout of pages, you must change the original files, recompile the site, and redeploy the layout. The only exception is the site configuration; you may make changes to the Web.config file on the production server without having to recompile the site.

This option provides the greatest degree of protection for your pages and the best performance at startup.

Precompiling for Deployment and Update

When you precompile for deployment and update, the compiler produces assemblies from all source code (except page code in single-file pages) and from other files that normally produce assemblies, such as resource files. The compiler converts .aspx files into single files that use the compiled code-behind model and copies them to the layout.

This option enables you to make limited changes to the ASP.NET Web pages in your site after compiling them. For example, you can change the arrangement of controls, colors, fonts, and other appearance aspects of pages. You can also add controls, as long as they do not require event handlers or other code.

When the site runs the first time, ASP.NET performs further compilation in order to create output from the markup.


Steve Wellens

My blog
0
SGWellens
2/20/2007 10:23:27 PM

Adding to this discussion, and hopefully helping more newbies like me...

Upon searching more I found there is the command line 'aspnet_compiler.exe' that assumably gets installed with the .net framework.

So, I 'can' produce a precompiled website/application with only the vwd express...Smile 

 

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_compiler -?
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.

Usage:
aspnet_compiler [-?] [-m metabasePath | -v virtualPath [-p physicalDir]]
                [[-u] [-f] [-d] [-fixednames] targetDir] [-c]
                [[-keyfile file | -keycontainer container]
                     [-aptca] [-delaySign]]
                [-errorstack]

-?            Prints this help text.
-m            The full IIS metabase path of the application. This switch cannot
              be combined with the -v or -p switches.
-v            The virtual path of the application to be compiled (e.g.
              "/MyApp"). If -p is specified, the physical path is used to
              locate the application. Otherwise, the IIS metabase is used, and
              the application is assumed to be in the default site (under
              "/LM/W3SVC/1/Root"). This switch cannot be combined with the -m
              switch.
-p            The physical path of the application to be compiled. If -p is
              missing, the IIS metabase is used to locate the app. This switch
              must be combined with -v.
-u            If specified, the precompiled application is updatable.
-f            Overwrites the target directory if it already exists. Existing
              contents are lost.
-d            If specified, the debug information is emitted during
              compilation.
targetDir     The physical path to which the application is compiled. If not
              specified, the application is precompiled in-place.
-c            If specified, the precompiled application is fully rebuilt. Any
              previously compiled components will be re-compiled. This option
              is always enabled when targetDir is specified.
-keyfile      The physical path to the strong name key file.
-keycontainer Specifies a strong name key container.
-aptca        If specified, the strong-name assembly will allow partially
              trusted callers.
-delaysign    If specified, the assembly is not fully signed when created.
-fixednames   If specified, the compiled assemblies will be given fixed names.
-nologo       Suppress compiler copyright message.
-errorstack   Shows extra debugging information that can help debug certain
              conditions.

Examples:

The following two commands are equivalent, and rely on the IIS metabase. The
compiled application is deployed to c:\MyTarget:
    aspnet_compiler -m /LM/W3SVC/1/Root/MyApp c:\MyTarget
    aspnet_compiler -v /MyApp c:\MyTarget

The following command compiles the application /MyApp in-place. The effect is
that no more compilations will be needed when HTTP requests are sent to it:
    aspnet_compiler -v /MyApp

The following command does *not* rely on the IIS metabase, as it explicitly
specifies the physical source directory of the application:
    aspnet_compiler -v /MyApp -p c:\myapp c:\MyTarget
  
Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе.
0
ksasp
2/21/2007 2:21:35 PM

Ok, new problem...(most likely my fault)

I created virtual directory called 'eli2' which is 'C:\eli2'...

I did 'aspnet_compiler -v /eli2 -p c:\eli2 c:\eli3'

When it finished, I had, inside c:\eli3, a  /bin directory with 2 dll's and some other  'blahblah.compiled' files...

 when I set IIS to use this directory (c:\eli3), it works fine locally...

but when I upload, to a host, it will work only as far as 'default.aspx' but no more.  I just get an error

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Any ideas?

TIA 


Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе.
0
ksasp
3/10/2007 12:17:51 AM

Solved this by changing webhosts...

So apparently there can be different (mis?)configurations from host to host.  Choose wisely...Tongue Tied 

PS Can we edit our own posts on this board? 


Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе.
0
ksasp
3/13/2007 1:35:56 PM
Reply:

Similar Artilces:

DLL hell AsaClient.DLL with dbdata9.dll with .NET
Development computer <old> has version 9.0.2.3381 Client computer <client> has version 9.0.2.3381 Development computer <new> has version 9.0.2.3632 Copied my .NET program bin directory from <old> to <new> and attempted to run it. Got the following error message: DLL version mismatch: C:\User\myprogram\bin\Debug\iAnywhere.Data.AsaClient.DLL(9.0.2.3881) C:\Program Files\Sybase\SQL Anywhere 9\win32\dbdata9.dll (9.0.2.3632) For deployment to <client> using <old>, I created a Visual Studio setup package. AsaClient.dll goes to t...

Embedded Resource .NET DLL into Another .NET DLL
Hi ! I want to embed Third party .NET dll into my own .NET dll uisng VS.NET . I know other files ( .BMP,.WAV etc ) can be done by changing the build action to Embedded Resource, But can that be done to another .NET dll in asp.net ? can you please point me towards right direction ? Thanks Suhail kaleem Not sure why you want to do this, but you can pretty much stick anything in as a binary/custom resource. There is a tool called "al.exe". Check out the documentation for more information: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptool...

Referencing a DLL or .NET DLL with VBscript
Hello everyone,  I have an ASP.NET web page that I would like to reference a DLL on a client workstation, excute a function and have it run on the client machine.I am building a simple CRM and want to reference the TAPI32 or TAPI3 DLL to be able to click a button and have it dial from the modem on the client PC.I have tried many things, such as making a custom control to writing client side vbscript in the HTML of the page that would reference a local DLL.  None of this seams to work and would like to be pointed in the right direction.Thanks much for any help!-John Hi,I think tha...

difference between .net Dll and Com+ Dll
Hi, I am just wondering if there is any difference between the two types of Dll?Acutally I am not too sure if .net Dll or com+ Dll are the correct terms. This is my understanding .... Let's say we have a main project that is written using C#.  If a developer writes some codes .. in, let's say, vb6 and then compile it into a Dll so that a .net application can use it. He is creating a com+ Dll. Then if another developer writes another set of codes using vb.net. In order for the main project (in c#) to use it, he needs to compile that code into Dll. In this case he is creating a ....

DLL in dll, not cpplib
Our C++ component's DLL is only found when in the dll directory at runtime. When exporting it is picked up from cpplib. Any ideas? The .props file has no path to the DLL, only it's name, so I guess it searches PATH to find it, but then it should find it in cpplib in both cases. -- Jonas Olsson Software Development Engineer Cambio Healthcare Systems Jonas Olsson wrote: > > Our C++ component's DLL is only found when in the dll directory at runtime. > When exporting it is picked up from cpplib. Any ideas? > The .props file has no path to the DLL, only ...

DLL
DLL virgin here - my first time. I have a function I frequently use and decided to put it into a DLL rather than always putting the source for it into new projects. So, I created a DLL ... found the instructions on the web and Built it (after a few tries). I saved the project (Library file) at \programs\D_XE\_Libraries And that is where I expected to find myLibrary.DLL But it is not there. It "Built" with no problems. Where did XE put this DLL file? Thanks for any help, Bob Watson Bob Watson wrote: > DLL virgin here - my first time. > > ...

Calling a DLL from a DLL
In the build stage I have no problem setting up to have My project's target1.EXE call target2.dll or target3.dll. However; having target2.dll call target3.dll I'm getting cannot open "target3class.hpp" error. Adding target3\release to the include directories of target2 doesn't change anything. Any suggestions? Glenn Turns out the $(___Optimadir) is not being set properly. I added the direct path to the include directory and that fixed it. Where does this environment variable get set at? Glenn Glenn Pope <gpope@islc.net> wrote in article <...

Include Dll in a Dll
I have a dll(mydata.dll) which I have created and it uses another external dll (mysql.dll) I currently need to reference both dlls in my projects but I would like to just be able to reference the mydata.dll. Is there anyway of doing this? I rebuilt my dll project and it now seems to work without referencing both DLLs, not sure why it was not working before....

JSS dll dependencies -- nspr4.dll and libnspr4.dll
It is confusing deploying JSS on Windows XP. The library jss4.dll depends on libnspr4.dll, not nspr4.dll as is installed with Firefox. Other dependent libraries such as nss3.dll depend on nspr4.dll. Should I copy and rename nspr4.dll to libnspr4.dll, or are these supposed to be different libraries? There is no useful guidance on the "Using JSS" page. --Steve Steve Mitchell wrote: > It is confusing deploying JSS on Windows XP. The library jss4.dll depends > on libnspr4.dll, not nspr4.dll as is installed with Firefox. Other > dependent libraries ...

How do I make vb.net DLL into COM DLL for backward compatibility?
Howdy all, I made a dll that has 2 classes in it, one with file methods (like createfile, deletefile) and one with email method (to send an email from webpages) .. it works great from asp.net and vb.net app .. but I also want it to be accessed from older apps, like VisualFoxPro. They can only use an API or a COM object (sorry about the lines, this form forum does not support source code formatting, so much for .NET :) is there an easy way to make my vb.net DLL into a COM object? Here is my class with method I need to compile into COM object (any additional advice is GREATLY appre...

What is the difference between a CSC compiled dll and a VS.NET compiled dll?
I'm having a bit of a problem getting a custom class to work on an aspx page. In the aspx page I have the following declaration. <%@ Page Language="C#" Inherits="SampleNamespace.SampleClass" %> SampleNamespace.dll is in the /bin directory. When I compile SampleNamespace.cs into SampleNamespace.dll using the command line compiler (csc), everything works fine. When I compile SampleNamespace.cs using VS.NET 2005, I get a "Could Not Load Type" error when I try to load the page. What's the difference between the two?  I would like to compile using VS.NET instead of the CSC. ...

I am unable to add any dll like FlashControl.dll or ColorPicker.dll
Hi I am unable to add any 3rd party dll like when i tried to add ColorPicker.dll i got error message F:\Projects\ColorPicker\ColorPicker_Solution\ColorPicker_WEB\Bin\ColorPicker.dll' is not a Microsoft .NET Module   Try taking the dll to other computer and test it there, if it's working then the problem is only in your computer! Yes it is working on other computer i know but the issue is i want to solve this on my computer hope you got thanks Seems to me that you'll need to run repair on your VS install.  http://forums.asp.net/t/1190789.aspxSolved it! I tur...

Deploy .Net dll as COM object
I recently have had success with a DLL to connect to Actuate 9.1 to generate reports. How do I deploy the DLL as a COM object? Tom Mackin http://teamsybase.net/blogs/?p=106 http://teamsybase.net/blogs/?p=236 Unfortunately, all the images were lost in one of the WordPress upgrades. There are versions of that article on the PBDJ site as well. On 28 Jul 2008 07:20:59 -0700, Tom Mackin <ThomasDOTMackinATLFGDOTcom> wrote: >I recently have had success with a DLL to connect to Actuate 9.1 to >generate reports. How do I deploy the DLL as a COM object? > &g...

Config File for a DLL in VB.NET
Hi, I have a config file for a DLL written in VB.NET. The problem is where to put the config file. I do not want to hard-code the location of the config file in the DLL and also do not want to put the path in config file of the container application. I tried several methods to get the path where the assesmbly resides... like System.Reflection.Assembly.GetExecutingAssembly.Location but everything failed.. Does anyone have ideas ??? Thanks, Anand Is this an application that several people will have installed or just one person? Several people would use it. ...

Web resources about - To dll or not to dll... - asp.net.config-deploy

DLL Hell - Wikipedia, the free encyclopedia
... memory space. While the phrase is Windows-specific and a derivation of the general cross-platform phrase " dependency hell ", the rhyme "DLL ...

Troubleshoot DLL problems with DLL Hijack Detect
Run a Windows program and it’ll often try to access functions or data in a Dynamic Link Library (a DLL file). If the program has provided a copy ...

.Net framework versions and dll hell
With .net version numbers increasing and increasing I recently encountered something which reminded me of dllhell . Which the .net framework ...

Microsoft releases tool to block DLL load hijacking attacks
Microsoft responded to reports of potential zero-day attacks against a large number of Windows apps by publishing a tool to block known exploits. ...

Apple OS X at Risk From DLL Hijacking Exploit
A Synack researcher alleges that Dynamic Link Libraries (DLLs) can be used to bypass Apple's Gatekeeper and other security products.

Beating Super Hexagon with OpenCV and DLL Injection
... the game is to capture the screen. [Val] tried Fraps and VLC, but lags of 2 seconds or more were not going to work. Then [Val] turned to DLL ...

De-Mystifying the Dark Corners of Windows: The Registry, DLLs, and More Explained
If your Windows chops extend in any capacity beyond novice, you've no doubt encountered the ever-cryptic Windows Registry, DLL files, User Account ...

C# Specifications: Using Visual Studio 2013 to compile a DLL and EXE
Learn how a developer evangeist thinks Using Visual Studio 2013 to compile your DLL and EXE is pretty easy when you use C# or Visual Basic, in ...

Microsoft fixes critical DLL hole in Office but not XP SP3
Patch Tuesday included Microsoft's first (and only) DLL hijacking patch

Schneider Electric Patches DLL Hijacking Bug in Wonderware Products
Several Schneider Electric Wonderware products are plagued by a high severity vulnerability that can be exploited for arbitrary code execution. ...

Resources last updated: 11/24/2015 7:38:21 AM