locked
Best practice to upload code to production platform RRS feed

  • Question

  • User363578564 posted

    as I know, the way to upload code to production platform from VS is by pressing "publish" button at VS

    it seems application pool will re-start and all sessions will be lost.

    As this will affect user experience, is there any better way to do?

    Wednesday, July 18, 2018 3:59 AM

All replies

  • User475983607 posted

    TW88

    as I know, the way to upload code to production platform from VS is by pressing "publish" button at VS

    it seems application pool will re-start and all sessions will be lost.

    As this will affect user experience, is there any better way to do?

    Use SQL to store session rather than InProc or design a solution that does not use Session.

    Session Reference

    https://msdn.microsoft.com/en-us/library/ms178581.aspx

    Wednesday, July 18, 2018 1:46 PM
  • User1120430333 posted

    TW88

    as I know, the way to upload code to production platform from VS is by pressing "publish" button at VS

    it seems application pool will re-start and all sessions will be lost.

    As this will affect user experience, is there any better way to do?

    You can do it off hours. Sometimes, you have periodic maintenance that must be done. So the site comes down for a little bit of time. You should have a notification page explaining when something like maintenance will occur and fore warn the clients of intended downtime. 

    Wednesday, July 18, 2018 8:09 PM
  • User363578564 posted

    Possible to do with task schedule so it can be updated in mid-night?

    Thursday, July 19, 2018 1:32 AM
  • User36583972 posted


    Hi TW88,

    Possible to do with task schedule so it can be updated in mid-night?

    The following ideas may helpful for you.

    You may can create a Windows Service and Timing updates.

    Before you update your web site, you can Stop IIS Website. After the update, restart IIS.

    Stop/Start IIS Website in .NET (C#)
    https://www.codeproject.com/Articles/21120/Stop-Start-IIS-Website-in-NET-C

    Walkthrough: Creating a Windows Service Application in the Component Designer:
    https://docs.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer

    A Simple Scheduler in C#
    https://www.codeproject.com/Articles/591271/A-Simple-Scheduler-in-Csharp

    Best Regards,

    Yong Lu

    Thursday, July 19, 2018 2:35 AM
  • User1120430333 posted

    TW88

    Possible to do with task schedule so it can be updated in mid-night?

    Yes, I have seen ASP.NET Web solution deployed programmically to IIS, and that was a program that all Web developer programmers used to deploy ASP.NET Web solutions to the IIS Web development server many years ago. How it was done, I don't know. But you can also post questions to the IIS forums.

    .https://forums.iis.net/

    You might be able to do something with Powershell  now of days. 

    https://octopus.com/blog/iis-powershell

    Thursday, July 19, 2018 2:59 AM