Results 1 to 9 of 9

Thread: compile aspx into dll

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59

    compile aspx into dll

    i was reading in one of my books that you can compile your code-behind, so that you can code your html/asp but still have the code in a dll which is executed.

    Does anyone know how to make that dll, and how to reference it in the aspx file ?

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    ASP.NET always compiles your code into a .dll (assembly). You can find the assembly in C:\WINDOWS\Microsoft.NET\Framework\v1.0.3423\Temporary ASP.NET Files

    Code Behind has nothing to do with this, it's only a seperation of UI stuff (html, client side script etc.) and server side code (vb.net, c# etc.)

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Location
    KL Malaysia
    Posts
    64
    Actually, it does. Try this article in 4guysfromrolla .

  4. #4
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    That's not true, that article is wrong !
    If you don't use code behind there is still a assembly generated.
    Just create an .aspx page without code behind, run it, and check for the following directory: C:\WINDOWS\Microsoft.NET\Framework\v1.0.3423\Temporary ASP.NET Files

  5. #5
    Lively Member
    Join Date
    Feb 2001
    Location
    KL Malaysia
    Posts
    64
    Yes, but what mandreko is requesting is using code behind, how to make the dll manually, and how to reference it in a aspx page. What's your point? The article answers quite a number of questions posted.

  6. #6

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59
    I haven't had time to play with that example yet, but i'm not sure it does quite what i was asking about. It was my understanding that you could compile your code-behind, so that your client could still edit the aspx page, but you keep your code hidden from them, so that if you needed to, they would be unable to edit that.

    Is my understanding wrong, or is that what's going on?

  7. #7
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    No, your understanding isn't wrong.
    Try the following:

    Create a Web App with an .aspx and its code-behind.
    Then, go to Project -> Copy Project and select "Only files to run this application".
    After you copied it some where check out the files in the directory, the code-behind files are compiled into an assembly and copied in the \bin directory.

  8. #8

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59
    and then once i have the assemblies in the bin folder, how do i go about publishing them? do the assemblies need to stay in a bin folder, or in the same directory as the aspx when i put them on a live IIS server?

  9. #9
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    it needs to be in the bin folder in the root of the web application's virtual directory.

    now how to make and use the dll.

    just compile the code into a dll..then you can reference it like any other dll

    Dim A as New namespace.class

    a.method()

    and so on.


    It think this is what you want.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width