{"id":2794,"date":"2011-01-06T09:39:22","date_gmt":"2011-01-06T09:39:22","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2011\/01\/06\/how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects\/"},"modified":"2022-08-16T01:09:32","modified_gmt":"2022-08-16T08:09:32","slug":"how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects\/","title":{"rendered":"How to Bin Deploy SQL Compact Edition 4.0 and Razor web projects"},"content":{"rendered":"<p>With the release of VS2010 SP1 Beta1, Web Matrix,&#160; and Razor QFE, we can build web projects containing SQL Compact Edition 4.0 sdf file and ASP.NET Web Pages with Razor syntax. However, this might be a problem when you are ready to deploy your project on a server that doesn\u2019t have the assemblies required to run SQL CE 4.0 and Razor pages. <\/p>\n<p>To solve this issue, we can make the project \u201cBin Deployable\u201d, similar to the way we do bin deploy an MVC project. If the hosting machine has ASP.NET 3.5 or later installed, then we just need to include the required assemblies in the bin folder when deploying the project.<\/p>\n<p>We can include required assemblies in a Web site or Web Application project with a few simple steps. You right click the project node in Solution Explorer and select \u201cAdd Deployable Dependencies\u2026\u201d context menu item.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2011\/01\/4747.MenuItem_thumb_1.png\"><img decoding=\"async\" style=\"border-right-width: 0px;float: none;border-top-width: 0px;border-bottom-width: 0px;margin-left: auto;border-left-width: 0px;margin-right: auto\" title=\"MenuItem\" border=\"0\" alt=\"MenuItem\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2011\/01\/4747.MenuItem_thumb_1.png\" width=\"553\" height=\"454\" \/><\/a> <\/p>\n<p>If there isn\u2019t SQL CE 4.0 nor Razor installed on the machine, the following dialog will pop up:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2011\/01\/5811.image_thumb_1.png\"><img decoding=\"async\" style=\"border-right-width: 0px;float: none;border-top-width: 0px;border-bottom-width: 0px;margin-left: auto;border-left-width: 0px;margin-right: auto\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2011\/01\/5811.image_thumb_1.png\" width=\"548\" height=\"228\" \/><\/a> <\/p>\n<p>If there\u2019s at least one of them installed, then the following dialog will pop up:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2011\/01\/5808.image_thumb_2.png\"><img decoding=\"async\" style=\"border-right-width: 0px;float: none;border-top-width: 0px;border-bottom-width: 0px;margin-left: auto;border-left-width: 0px;margin-right: auto\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2011\/01\/5808.image_thumb_2.png\" width=\"546\" height=\"225\" \/><\/a> <\/p>\n<p>Visual Studio detects what components are present on the machine and the corresponding options will be enabled; you then can choose what to include in the bin folder. In the above picture, only the option for SQL Server Compact is enabled on a machine with SQL Server Compact 4.0 installed. If it\u2019s a website, the required assemblies will be copied to \u201cBin\u201d folder; if it\u2019s a WAP, they will be copied to \u201c_bin_deployableAssemblies\u201d folder. Note that your selection will not be persisted after the dialog is closed.<\/p>\n<p>Now you can deploy your web projects the same way you deploy any other web project. For a Web Application Project (WAP), you can use Deployment feature made available with VS2010. For both web site or WAP, you can use \u201cCopy Web\u201d, or \u201cWeb Deployment Project\u201d to push all the files needed to deploy to a specific directory, test it, and then copy the the host.<\/p>\n<p>Hope it helps!<\/p>\n<p>Thanks,    <br \/>-Anh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the release of VS2010 SP1 Beta1, Web Matrix,&#160; and Razor QFE, we can build web projects containing SQL Compact Edition 4.0 sdf file and ASP.NET Web Pages with Razor syntax. However, this might be a problem when you are ready to deploy your project on a server that doesn\u2019t have the assemblies required to [&hellip;]<\/p>\n","protected":false},"author":404,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[],"class_list":["post-2794","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet"],"acf":[],"blog_post_summary":"<p>With the release of VS2010 SP1 Beta1, Web Matrix,&#160; and Razor QFE, we can build web projects containing SQL Compact Edition 4.0 sdf file and ASP.NET Web Pages with Razor syntax. However, this might be a problem when you are ready to deploy your project on a server that doesn\u2019t have the assemblies required to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/2794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/404"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=2794"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/2794\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=2794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=2794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=2794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}