Results 1 to 12 of 12

Thread: [RESOLVED] How do you update precompiled websites

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Resolved [RESOLVED] How do you update precompiled websites

    I have always been uploading my websites with all source code and everything. Maintaining the website this way has been easy, when updating a single webpage I just need to reupload the .aspx and .vb files for that page and I'm done, easy.

    Now I am trying to learn how to use precompiled websites using the "Build" > "Publish Web Site" features from the visual studio menu.

    Here's a few this that I need some advise on:

    When using this feature visual studio wants to delete everything from the destination and then publish. The problem is the website allows users to upload files to the website and this will delete their data. Is there and easier way to do this?

    This may be the answer to the above question, lets say I publish to a folder on my desktop instead and only upload the files needed. I noticed that If I change one webpage I have to reupload all webpages and files from the bin folder. Is this how it is meant to work?

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: How do you update precompiled websites

    That's a good question since i would have to publish in a dll form soon.I'll be keeping a track on this thread.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: How do you update precompiled websites

    Hello,

    In this situation, I typically "publish" to a local folder on my own machine, and then I only upload (FTP) the files which have changed to my web server, rather than uploading everything.

    Gary

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Re: How do you update precompiled websites

    What I found was that each time you republish, the dll files in the bin directory get a different name.

    For example App_Web_123.dll could change to App_Web_abc.dll.

    I can imagine this wouldn't be a problem for small 5 to 10 page websites, but large websites will be a dll nightmare to manage.

    So basically right now you update a webpage and publish, then you upload the webpage updated to the ftp server. Then you go to the bin directory and also upload the new dll ralated to that page and delete the old one. Is this how it is works?

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: How do you update precompiled websites

    Hello,

    Can you confirm exactly what project type you are using, and what mechanism you are using to publish the website? I am surprised to hear that the DLL is changing name.

    Gary

  6. #6
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    India
    Posts
    310

    Re: How do you update precompiled websites

    very nice thread......even i am facing this prb from last 2 years bt nt taking this as prb....

    I dnt think it changes the dll name bt it changes the referance....everytime for minor change i publish my project and replaces my bin folder....

    is there any other way???
    Sagar
    VB6, VB.net,C#,ASP, ASP.net MSSQL, MYSQL

  7. #7
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: How do you update precompiled websites

    There are several "publish" options. From asp.net 2 onwards (I think, I know VS 2010 has it) there are options to "use fixed naming and single page assemblies" and "allow site to be updateable". Selecting these publish options builds individual code files and places them in the bin folder and leaves the design (aspx) page markup intact.

    So if you make a change to a aspx page or code/behind page you still need to publish the site but you only need to ftp/upload the changed aspx and-or vb/cs files. Changes to code files in the app_code folder need the app_code........ name prefixed files in the bin folder uploaded.

    Lastly if any code behind or app_code file is published and uploaded to the server (bin folder) the site will be recomplied on the server and the site restarted (within asp not IIS or windows) meaning sessions will be lost.

    I find a published site whatever the publish options perform better and don't suffer from ambibious namespace errors after changes, especially larger sites.
    The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Re: How do you update precompiled websites

    So Glad I joined this forum.......

    Can you confirm exactly what project type you are using
    It's a standard ASP.NET Website Project

    There are several "publish" options. From asp.net 2 onwards (I think, I know VS 2010 has it) there are options to "use fixed naming and single page assemblies" and "allow site to be updateable". Selecting these publish options builds individual code files and places them in the bin folder and leaves the design (aspx) page markup intact.
    Ok, I tried the "use fixed naming and single page assemblies" and now the dll doesn't change names, awesome, thanks for that.


    OK just one more question. For large sites e.g website with 500 pages, it will easier to have one dll, is it possible to compile the website to one dll instead of one for each and every page?
    Last edited by Developer2007; Mar 29th, 2011 at 03:14 PM.

  9. #9
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: How do you update precompiled websites

    A web application project will be built to a single dll if you include no other assemblies in the project. A web site project is not as you have discovered.

    To see the difference in VS click file>new project and select asp.net web application. once created open solution explorer and click the My Project folder, you will see all the project build, deploy etc options.
    The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded.

  10. #10
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: How do you update precompiled websites

    Quote Originally Posted by Developer2007 View Post
    What I found was that each time you republish, the dll files in the bin directory get a different name.

    For example App_Web_123.dll could change to App_Web_abc.dll.

    I can imagine this wouldn't be a problem for small 5 to 10 page websites, but large websites will be a dll nightmare to manage.

    So basically right now you update a webpage and publish, then you upload the webpage updated to the ftp server. Then you go to the bin directory and also upload the new dll ralated to that page and delete the old one. Is this how it is works?
    When I first started using ASP.Net a few years ago - having used 'traditional' ASP for years - I was horrified at the idea of publishing the whole site every time you made a minor change to anything. And, having done a bit of VB, I was afraid of dll hell.

    But, everything I read said that publishing the whole site - into one or a few dlls depending on whether it's an application or not - would have significant performance benefits. And, that in .net dll hell was a thing of the past as it effectively took care of registering dlls etc.

    So, I took a deep breath on my first site and started publishing web site projects with just 'Allow this precompiled site to be updatable' ticked and, several hundred publishes later (of up to 8 web sites - to UAT and Live servers), so far, so good.

    My sites are on an intranet so I just publish them in the evening and don't have to worry about session issues. The idea of having an assembly for every page would make me nervous.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Re: How do you update precompiled websites

    Quote Originally Posted by brin351 View Post
    A web application project will be built to a single dll if you include no other assemblies in the project. A web site project is not as you have discovered.

    To see the difference in VS click file>new project and select asp.net web application. once created open solution explorer and click the My Project folder, you will see all the project build, deploy etc options.
    Interesting, I will need to look into the other pros and cons of using one over the other. Thanks.

  12. #12
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] How do you update precompiled websites

    One of the big difference between the two is the lack of a csproj or vbproj file. If you are looking to auto build the web site then you would need to use the AspNetCompiler Task, rather than a straight up project file, which seems a little unnatural to me.

    Gary

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