• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

如何bin部署sqlce4.0的ASP.NETmvc3网站

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

参考这里:

How to Bin Deploy SQL Compact Edition 4.0 and Razor web projects

With the release of VS2010 SP1 Beta1, Web Matrix,  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’t have the assemblies required to run SQL CE 4.0 and Razor pages.

To solve this issue, we can make the project “Bin Deployable”, 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.

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 “Add Deployable Dependencies…” context menu item.

If there isn’t SQL CE 4.0 nor Razor installed on the machine, the following dialog will pop up:

If there’s at least one of them installed, then the following dialog will pop up:

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’s a website, the required assemblies will be copied to “Bin” folder; if it’s a WAP, they will be copied to “_bin_deployableAssemblies” folder. Note that your selection will not be persisted after the dialog is closed.

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 “Copy Web”, or “Web Deployment Project” to push all the files needed to deploy to a specific directory, test it, and then copy the the host.

Hope it helps!


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap