How to Update Remote Web Server with New Code-behind files

Discussion in 'ASP .Net' started by Chris, Jan 30, 2004.

  1. Chris

    Chris Guest

    I work on a development server (Server A), and have a staging server (Server
    B), where updated ASP.Net files from Server A are sent to. I noticed that
    Server B will reflect changes made to .aspx files just by copying the new
    files from Server A.

    Server B only has the framework installed, and the project folder structure
    is enormous (100MB+). I know that I can rebuild the project on Server A,
    which has .Net Studio, and copy the new project to Server B, but this would
    take a very long time for each instance a code-behind file is updated.We
    tried restarting IIS each time a code-behind file is updated, but the
    changes are still not reflected.

    What is the best way to copy code-behind files (c#) to Server B, and have
    the changes reflected?

    Does this have to do with the "debug" attribute in the web.config file?
    Server A has it set to "true" <compilation debug="true"/>, and Server B has
    it set to "false" to improve performance.

    Thanks,
    Chris
    Chris, Jan 30, 2004
    #1
    1. Advertising

  2. Chris

    Marina Guest

    You need to recompile your project, and send the new DLL for the project
    over to the other server. If you don't change any code in the codebehind,
    but just the front end UI, then you can copy just the .aspx over.

    The codebehind class is just text. It's the dll that has compiled executable
    code based on this text that is actually needed.

    "Chris" <> wrote in message
    news:...
    > I work on a development server (Server A), and have a staging server

    (Server
    > B), where updated ASP.Net files from Server A are sent to. I noticed that
    > Server B will reflect changes made to .aspx files just by copying the new
    > files from Server A.
    >
    > Server B only has the framework installed, and the project folder

    structure
    > is enormous (100MB+). I know that I can rebuild the project on Server A,
    > which has .Net Studio, and copy the new project to Server B, but this

    would
    > take a very long time for each instance a code-behind file is updated.We
    > tried restarting IIS each time a code-behind file is updated, but the
    > changes are still not reflected.
    >
    > What is the best way to copy code-behind files (c#) to Server B, and have
    > the changes reflected?
    >
    > Does this have to do with the "debug" attribute in the web.config file?
    > Server A has it set to "true" <compilation debug="true"/>, and Server B

    has
    > it set to "false" to improve performance.
    >
    > Thanks,
    > Chris
    >
    >
    Marina, Jan 30, 2004
    #2
    1. Advertising

  3. CodeBehind source files do not need to be there in production, provided you
    have compiled all of them into an assembly dll. (which is stored in the /bin
    folder of your applications root). Infact the CodeBehind keyword in the
    @Page directive is completely ignored by asp.net. (It's only a visual studio
    attribute). You can get around this if you replace
    CodeBehind="blah.aspx.cs" with src="blah.aspx.cs", but then it will be
    compiled by the JIT compiler when the page is requested.

    If this is not the issue and you actually want the codebehind files on
    your second server, you can either use xcopy deployment, or "copy project"
    from the project menu.

    HTH,
    --Michael

    "Chris" <> wrote in message
    news:...
    > I work on a development server (Server A), and have a staging server

    (Server
    > B), where updated ASP.Net files from Server A are sent to. I noticed that
    > Server B will reflect changes made to .aspx files just by copying the new
    > files from Server A.
    >
    > Server B only has the framework installed, and the project folder

    structure
    > is enormous (100MB+). I know that I can rebuild the project on Server A,
    > which has .Net Studio, and copy the new project to Server B, but this

    would
    > take a very long time for each instance a code-behind file is updated.We
    > tried restarting IIS each time a code-behind file is updated, but the
    > changes are still not reflected.
    >
    > What is the best way to copy code-behind files (c#) to Server B, and have
    > the changes reflected?
    >
    > Does this have to do with the "debug" attribute in the web.config file?
    > Server A has it set to "true" <compilation debug="true"/>, and Server B

    has
    > it set to "false" to improve performance.
    >
    > Thanks,
    > Chris
    >
    >
    Michael Ramey, Jan 30, 2004
    #3
  4. Chris

    Chris Guest

    So all that's needed on Server B is to overwrite the existing
    bin\projectname.dll with the updated one from Server A?

    Great.
    Thanks


    "Michael Ramey" <raterus@localhost> wrote in message
    news:...
    > CodeBehind source files do not need to be there in production, provided

    you
    > have compiled all of them into an assembly dll. (which is stored in the

    /bin
    > folder of your applications root). Infact the CodeBehind keyword in the
    > @Page directive is completely ignored by asp.net. (It's only a visual

    studio
    > attribute). You can get around this if you replace
    > CodeBehind="blah.aspx.cs" with src="blah.aspx.cs", but then it will be
    > compiled by the JIT compiler when the page is requested.
    >
    > If this is not the issue and you actually want the codebehind files on
    > your second server, you can either use xcopy deployment, or "copy project"
    > from the project menu.
    >
    > HTH,
    > --Michael
    >
    > "Chris" <> wrote in message
    > news:...
    > > I work on a development server (Server A), and have a staging server

    > (Server
    > > B), where updated ASP.Net files from Server A are sent to. I noticed

    that
    > > Server B will reflect changes made to .aspx files just by copying the

    new
    > > files from Server A.
    > >
    > > Server B only has the framework installed, and the project folder

    > structure
    > > is enormous (100MB+). I know that I can rebuild the project on Server

    A,
    > > which has .Net Studio, and copy the new project to Server B, but this

    > would
    > > take a very long time for each instance a code-behind file is updated.We
    > > tried restarting IIS each time a code-behind file is updated, but the
    > > changes are still not reflected.
    > >
    > > What is the best way to copy code-behind files (c#) to Server B, and

    have
    > > the changes reflected?
    > >
    > > Does this have to do with the "debug" attribute in the web.config file?
    > > Server A has it set to "true" <compilation debug="true"/>, and Server B

    > has
    > > it set to "false" to improve performance.
    > >
    > > Thanks,
    > > Chris
    > >
    > >

    >
    >
    Chris, Jan 30, 2004
    #4
  5. so easy isn't it :)

    "Chris" <> wrote in message
    news:%...
    > So all that's needed on Server B is to overwrite the existing
    > bin\projectname.dll with the updated one from Server A?
    >
    > Great.
    > Thanks
    >
    >
    > "Michael Ramey" <raterus@localhost> wrote in message
    > news:...
    > > CodeBehind source files do not need to be there in production, provided

    > you
    > > have compiled all of them into an assembly dll. (which is stored in the

    > /bin
    > > folder of your applications root). Infact the CodeBehind keyword in the
    > > @Page directive is completely ignored by asp.net. (It's only a visual

    > studio
    > > attribute). You can get around this if you replace
    > > CodeBehind="blah.aspx.cs" with src="blah.aspx.cs", but then it will be
    > > compiled by the JIT compiler when the page is requested.
    > >
    > > If this is not the issue and you actually want the codebehind files on
    > > your second server, you can either use xcopy deployment, or "copy

    project"
    > > from the project menu.
    > >
    > > HTH,
    > > --Michael
    > >
    > > "Chris" <> wrote in message
    > > news:...
    > > > I work on a development server (Server A), and have a staging server

    > > (Server
    > > > B), where updated ASP.Net files from Server A are sent to. I noticed

    > that
    > > > Server B will reflect changes made to .aspx files just by copying the

    > new
    > > > files from Server A.
    > > >
    > > > Server B only has the framework installed, and the project folder

    > > structure
    > > > is enormous (100MB+). I know that I can rebuild the project on Server

    > A,
    > > > which has .Net Studio, and copy the new project to Server B, but this

    > > would
    > > > take a very long time for each instance a code-behind file is

    updated.We
    > > > tried restarting IIS each time a code-behind file is updated, but the
    > > > changes are still not reflected.
    > > >
    > > > What is the best way to copy code-behind files (c#) to Server B, and

    > have
    > > > the changes reflected?
    > > >
    > > > Does this have to do with the "debug" attribute in the web.config

    file?
    > > > Server A has it set to "true" <compilation debug="true"/>, and Server

    B
    > > has
    > > > it set to "false" to improve performance.
    > > >
    > > > Thanks,
    > > > Chris
    > > >
    > > >

    > >
    > >

    >
    >
    Michael Ramey, Jan 30, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    562
    Alphonse Giambrone
    Jun 28, 2003
  2. =?Utf-8?B?Um9iZXJ0?=

    Update server side asp variable in page behind code

    =?Utf-8?B?Um9iZXJ0?=, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    321
    Kevin Spencer
    Feb 4, 2004
  3. Jitendra Singh via .NET 247
    Replies:
    1
    Views:
    761
    Brock Allen
    Mar 30, 2005
  4. freenews.netfront.net
    Replies:
    2
    Views:
    3,879
    Daniel Fisher\(lennybacon\)
    Nov 14, 2005
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    460
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
Loading...

Share This Page