locked
deploy web application vs web site RRS feed

  • Question

  • User2146470223 posted

    Hi,

    as I never deployed a web application before but only web site solutions: do I need a different setting on my server (e.g. under IIS) or can I just do a remote deploy and the server will recognize everything when it sees the dll?

    regards,

    Pascal

    Wednesday, December 19, 2018 12:07 AM

Answers

  • User-821857111 posted

    I use FTP to deploy web applications, the same as when they were web sites. The only difference is that you need to "publish" the web application first. I publish to the local file system and then use FTP to upload the published artefacts. If you have chosen not to make your pages/view updateable, you should end up with a collection of marker files for the pages, and a bin folder containing the compiled output. All of that needs to be uploaded. ASP.NET will know to load the application dll when the application starts in IIS.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 19, 2018 8:59 AM

All replies

  • User-821857111 posted

    I use FTP to deploy web applications, the same as when they were web sites. The only difference is that you need to "publish" the web application first. I publish to the local file system and then use FTP to upload the published artefacts. If you have chosen not to make your pages/view updateable, you should end up with a collection of marker files for the pages, and a bin folder containing the compiled output. All of that needs to be uploaded. ASP.NET will know to load the application dll when the application starts in IIS.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 19, 2018 8:59 AM
  • User2146470223 posted

    Hi Mike,

    Just to make sure: I have to delete all aspx and related files from the server first and then I upload the published content. The server then loads the site from the dll as soon as someone accesses the site. No further change on server side needed like telling the server load from dll.

    When publishing should I use any of the 3 options under advanced settings?

    Afterwards I upload the files to the bin folder directly or under bin\release\Publish?

    Wednesday, December 19, 2018 11:14 PM
  • User-1174608757 posted

    Hi Translating-it

       Remove additional files  at destination means when you publish your application to the site,other  files in site will be removed.

     Precompile during  publishing means when you publish the application, the files you publish  will be precompiled as  .dll  first.

     Exclude files from the App_Data folder means it will remove files in APP_Date folder.

     So ,according to your description ,you should select the option' Remove additional files  at destination'.

     Else ,you only need to upload  Publish folder without the whole bin folder.

    Best Regards

    Wei Zhang

    Thursday, December 20, 2018 10:53 AM
  • User2146470223 posted

    Thanks Wei.

    Am a bit puzzled now that I published the site to a local folder, I see that in fact it copies all aspx files to the publish folder too. I thought/understood I would only get a dll/program file …

    on the other side this answers a few other questions. So I could directly publish via FTP and not lose any files or need to delete existing aspx files first.

    Thursday, December 20, 2018 3:45 PM
  • User475983607 posted

    Am a bit puzzled now that I published the site to a local folder, I see that in fact it copies all aspx files to the publish folder too. I thought/understood I would only get a dll/program file …

    No, the ASPX files are required in Web Forms.  The ASPX file is how the request maps to the code by reading the page directive.  It also contains the page markup.

    on the other side this answers a few other questions. So I could directly publish via FTP and not lose any files or need to delete existing aspx files first.

    There's not need to deploy an ASPX file if the ASPX file has not changed since the last deployment.  I would simply follow Mikesdotnetting's advice.

    Thursday, December 20, 2018 4:22 PM
  • User753101303 posted

    Hi,

    If you open those ASPX files you should see a sentence asking for not removing this file. This is basically just a "placeholder" so that IIS knows the request needs to be processed (else it would return likely a 404 not found error).

    I don't think it should change much. AFAIK you should able to publish the web application the same way you used previosuly (or you were editing the site directly on the server ??)

    Thursday, December 20, 2018 4:29 PM
  • User2146470223 posted

    yes, I edited directly on the server as it was a web site project.

    no, they seem to contain the same text as on the site itself. I cannot find any comment about not deleting the file, but there are no code behind files there. I guess they are contained in the ddl?

    Thursday, December 20, 2018 4:54 PM
  • User475983607 posted

    yes, I edited directly on the server as it was a web site project.

    no, they seem to contain the same text as on the site itself. I cannot find any comment about not deleting the file, but there are no code behind files there. I guess they are contained in the ddl?

    As already stated, the aspx files are needed.  The code behind is in the DLL.

    Thursday, December 20, 2018 5:38 PM
  • User753101303 posted

    Ok was to understand if you had a previous publish experience. Even with a web site you usually work on a copy and publish that once done rather than working directly on the production site (which can cause user issues).

    When using "Build", "Publish" you have multiple options for publishing your web application project depending on your constraints and what your hosting service offers (FTP, network share, msdeploy, Azure service and maybe more). With your site you were using a network share ?

    If you open an ASPX file, it is still ASPX markup ? This is not an all or nothing option but you can choose what is compiled (this is an option in the publishing profile). Even if ASPX files are compiled into DLLs you'll still get them with a content such as "Please do not delete this file". It allows to IIS to handle correctly request to those files (if removed you would have a 404 not found error as by default the first step for IIS is to see you have an existing resource for this http request).

    Thursday, December 20, 2018 5:45 PM
  • User2146470223 posted

    Thanks. Deleting existing *.vb files and uploading the files via filezilla worked. Site is running. ;)

    Which files get deleted with the option "remove additional files" if I would use it with option to publish directly via FTP?

    Thursday, December 20, 2018 10:58 PM
  • User2146470223 posted

    @ Patrice

    I never had user issues as I tested changes on a sandbox part of the site before making them public

    You mean for the web app? I did a publish to local folder and uploaded the files to the server like mike suggested.

    It's still markup. I could not find which option would change from markup to don't delete message. But right now, as long as it works fine, it's ok for me.

    Friday, December 21, 2018 9:48 AM