locked
What are some best practices to follow when deploying a WebPages website? RRS feed

  • Question

  • User1313602441 posted
    There are quite a few number of asp.net webpages tutorials and articles that talk about best practices when deploying a website.
    That is, what are those development code, procedures and techniques that should not be kept in a hosted website?
    When should one consider migrating from SQL Compact CE to SQL Server?
    Of what use is the web.config file?
    Pardon my naivity, but I would like to really what I shouldn't be doing on a real time website.
    Thursday, August 27, 2015 5:53 PM

Answers

  • User2024324573 posted

    That is, what are those development code, procedures and techniques that should not be kept in a hosted website?

    The deployed site only contains binaries (dlls), configurations, scripts, front-end files etc. Source code files are not deployed to the server. Deployment tools such as Web Deploy, can determine automatically what should be deployed to the server - it includes only those are necessary for the site to be running. The target server (IIS) need to be configured also to run the web site.

    When should one consider migrating from SQL Compact CE to SQL Server?

    SQL Compact CE is only for development purpose i.e. used within Visual Studio when you do the development of your sites or applications. When you finish the development you need to deploy them for testing or staging before production deployment. In test/stage server you need to use SQL Server database as you are not using Visual Studio there, so to deploy to test server you need to migrate the database. Also at the time of production deployment you need to migrate the database as well.

    Of what use is the web.config file?

    Web.config is an XML file which contains all the configuration settings for the applications such as database connection strings, key-value pairs of variables used within the sites/application and other settings that are generated by the framework or plugins that are being used. So to change any configuration, you can do it by editing the web.config file without changing any code.

    Hope this will help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 27, 2015 6:10 PM
  • User379720387 posted

    When the db size reaches the limits.

    When memory usage on the server is reaching its limits.

    When page requests are slow.

    Etc.

    One benefit of SQL CE is that is very easy to maintain the db, just copy the file back and forth.

    SQL (Express) is a pain.

    If you stick to Visual Studio 2012, SQL CE is fully supported and a publish action also updates the db.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 7, 2015 4:30 PM

All replies

  • User2024324573 posted

    That is, what are those development code, procedures and techniques that should not be kept in a hosted website?

    The deployed site only contains binaries (dlls), configurations, scripts, front-end files etc. Source code files are not deployed to the server. Deployment tools such as Web Deploy, can determine automatically what should be deployed to the server - it includes only those are necessary for the site to be running. The target server (IIS) need to be configured also to run the web site.

    When should one consider migrating from SQL Compact CE to SQL Server?

    SQL Compact CE is only for development purpose i.e. used within Visual Studio when you do the development of your sites or applications. When you finish the development you need to deploy them for testing or staging before production deployment. In test/stage server you need to use SQL Server database as you are not using Visual Studio there, so to deploy to test server you need to migrate the database. Also at the time of production deployment you need to migrate the database as well.

    Of what use is the web.config file?

    Web.config is an XML file which contains all the configuration settings for the applications such as database connection strings, key-value pairs of variables used within the sites/application and other settings that are generated by the framework or plugins that are being used. So to change any configuration, you can do it by editing the web.config file without changing any code.

    Hope this will help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 27, 2015 6:10 PM
  • User1313602441 posted
    Thanks for the response.
    But am not just talking about the web deploy feature. Am refering to the entire process of putting a website on the internet.
    I read a tutorial on ASP.NET that said you should always encrypt the web.config file. I have never seen this as an issue in any other tutorial.
    And again, there are some web hosts who support SQL CE, just the same way they support MS Access and SQL Server. But am asking: when shouldn't one use SQL CE?
    These are just some of the issues am concerned with.
    And I hope the answers I receive will open my eyes to new things...
    Friday, August 28, 2015 8:10 AM
  • User-1980594115 posted

    Confidential info in the web.config file is not good. Usually ones save that data, such as the connection string in the App_Data folder and reference it in the web.config file.

    Monday, August 31, 2015 1:58 PM
  • User-821857111 posted

    The deployed site only contains binaries (dlls), configurations, scripts, front-end files etc. Source code files are not deployed to the server.

    That's not the case with Web Site projects, which is the type of project you get when you create a Web Pages site. It is possible to pre-compile a web pages site, but you can also deploy the source code files.

    SQL Compact CE is only for development purpose
    This is not true, You can deploy a SQL Compact database to a live site. SQLCompact 4.0 was originally recommended as a replacement for Access. It's perfectly acceptable for smaller sites such as blogs etc. You do not need to migrate to SQL Server.

    Monday, August 31, 2015 2:54 PM
  • User-821857111 posted

    I read a tutorial on ASP.NET that said you should always encrypt the web.config file
    The only reason you might consider encrypting your web.config file (or some of its content) is if it contains sensitive data such as passwords, and you think there is a reasonable chance someone without the correct authority can get access to it. The reality is that if someone gets access to the web.config on the hosting server, you have far more serious issues to worry about.

    Monday, August 31, 2015 3:02 PM
  • User379720387 posted

    I have some thoughts to share on SQL CE vs SQL (Express)

    SQL CE is free and remains free even when the application is live. An application with CE can be hosted in a website hosting environment, and you pay only for the website hosting.

    SQL (Express):

    Express is free locally, it is free to use in the cloud as well, however the cost for running it hanges dramatically. You either need a Virtual Machine to run SQL (Express) or you need to pay Microsoft to use SQL Azure.

    CE is lacking some of the nice features of SQL (Express), and sometimes it is a challenge to find workarounds for certain functionality.  

    Both SQL CE and SQL Express have limitations to the db size.

    Microsoft is going through all sorts of efforts to make you a paying customer, and SQL CE does not fit in that picture.  CE has been deprecated which is Microsoft lingo for we will make it difficult for you to use. Convenient and native SQL CE support was removed from Visual Studio 2013.

    There are 3rd party solutions such as SQLite / SQL Compact toolbox that work in Visual Studio 2013, but they are not as convenient as how things were in 2012.

    Monday, August 31, 2015 3:21 PM
  • User-821857111 posted

    Microsoft is going through all sorts of efforts to make you a paying customer, and SQL CE does not fit in that picture. 
    The reason they have dropped support isn't so they can rinse you for more cash. If that was actually true, they would never have introduced it in the first place. They dropped it in favour of SQLite. That is their adopted file-based system going forward. They are working on a new EF provider for it. 

    MS have finally embraced the idea that a lot of the best solutions are already out there in Open Source Land. They have decided to work with them rather than continually expend effort on trying to compete with them. Their real revenue focus is Azure and mobile. Even the full version of Visual Studio is free these days.

    Monday, August 31, 2015 3:45 PM
  • User379720387 posted

    SQLite does not nearly have the refinement that SQL CE has, from what little exposure I have had to it.

    Monday, August 31, 2015 3:49 PM
  • User1313602441 posted
    Thanks for the response guys!
    I am currently working on a classified ads website.
    But I want to understand what issues I'm likely to encounter if I launch the Website with ASP.NET Web Pages.
    I have been reading "the web application hacker's handbook" on Web Security and other books for RAD.
    But an still concerned: using Razor and SQL CE, when should I brace up for scalability?
    What indices can I use to reach a conclusion that the website is due for scaling?
    Monday, September 7, 2015 4:20 PM
  • User379720387 posted

    When the db size reaches the limits.

    When memory usage on the server is reaching its limits.

    When page requests are slow.

    Etc.

    One benefit of SQL CE is that is very easy to maintain the db, just copy the file back and forth.

    SQL (Express) is a pain.

    If you stick to Visual Studio 2012, SQL CE is fully supported and a publish action also updates the db.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 7, 2015 4:30 PM
  • User1313602441 posted
    Thanks.
    Monday, September 14, 2015 3:28 PM