Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Compilation into a DLL

Compilation into a DLL

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasedotnethelp
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bulky Fellow
    wrote on last edited by
    #1

    I've recently started ASP.NET, and am making simple pages (in C#). I have a simple app, with one page - index.aspx, and it's codebehind file index.aspx.cs The index page has an asp label with the id 'myLabel' The page load in index.aspx.cs sets this myLabel to "Hello world". Simple. (basically myLabel.Text = "Hello world") I decided not to go the codebehind way, and instead compile the index.aspx.cs file into a dll. When using .NET Framework 1.1, it all works fine. I put the dll (generated at the cmd prompt by csc /t:library index.aspx.cs) into a bin folder, remove the .cs file, and the app works fine. When I do this in .NET 2.0, I get the following message when trying to compile the DLL: index.aspx.cs(17,13): error CS0103: The name 'myLabel' does not exist in the current context Can someone explain what I'm doing wrong? Am I supposed to do things differently for .NEt 2.0?

    ASP - AJAX is SEXY. PERIOD.

    R 1 Reply Last reply
    0
    • B Bulky Fellow

      I've recently started ASP.NET, and am making simple pages (in C#). I have a simple app, with one page - index.aspx, and it's codebehind file index.aspx.cs The index page has an asp label with the id 'myLabel' The page load in index.aspx.cs sets this myLabel to "Hello world". Simple. (basically myLabel.Text = "Hello world") I decided not to go the codebehind way, and instead compile the index.aspx.cs file into a dll. When using .NET Framework 1.1, it all works fine. I put the dll (generated at the cmd prompt by csc /t:library index.aspx.cs) into a bin folder, remove the .cs file, and the app works fine. When I do this in .NET 2.0, I get the following message when trying to compile the DLL: index.aspx.cs(17,13): error CS0103: The name 'myLabel' does not exist in the current context Can someone explain what I'm doing wrong? Am I supposed to do things differently for .NEt 2.0?

      ASP - AJAX is SEXY. PERIOD.

      R Offline
      R Offline
      Reza Raad
      wrote on last edited by
      #2

      you must PUBLISH your website if you want use dll instead of code files go to menu on VisualStudio and find publish...

      Human knowledge belongs to the world http://www.rad.pasfu.com/index.php

      B 1 Reply Last reply
      0
      • R Reza Raad

        you must PUBLISH your website if you want use dll instead of code files go to menu on VisualStudio and find publish...

        Human knowledge belongs to the world http://www.rad.pasfu.com/index.php

        B Offline
        B Offline
        Bulky Fellow
        wrote on last edited by
        #3

        I don't think that's the solution. My code works fine in .NET 1.1 I don't have visual studio etc.

        ASP - AJAX is SEXY. PERIOD.

        R 1 Reply Last reply
        0
        • B Bulky Fellow

          I don't think that's the solution. My code works fine in .NET 1.1 I don't have visual studio etc.

          ASP - AJAX is SEXY. PERIOD.

          R Offline
          R Offline
          Reza Raad
          wrote on last edited by
          #4

          did you mean this?: Create a DLL without Visual Studio[^]

          Human knowledge belongs to the world http://www.rad.pasfu.com/index.php

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups