惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
GbyAI
GbyAI
M
MIT News - Artificial intelligence
美团技术团队
罗磊的独立博客
雷峰网
雷峰网
量子位
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
D
Docker
小众软件
小众软件
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
WordPress大学
WordPress大学
V
V2EX
博客园_首页
腾讯CDC
The Cloudflare Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - Mamboer

[IE6]IE6:hover失效 html5文件上传-iis7报奇怪的404(NotFound)错误 Windows Command Line Find and replace - Made easy with FART.exe Editplus-关联yuicompressor进行JS和CSS的压缩 ubuntu-安装aptana3 Ubuntu-环境配置文件 Ubuntu安装Git客户端 Ubuntu安装Chrome最新版 ubuntu-restricted-extras 高效率编辑器VIM-操作篇 Ubuntu安装雅黑字体 试用Opera11.10 build2053 版本的speed dial功能 Building Vim on Ubuntu Ubuntu安装Mercurial utf-8格式之no bom和+bom [PM]-组织者角色 IE6问题Q&A,你懂的... Logo一个-小凡设计 正则表达式-用户名规则之只含汉字、数字、字母、下划线
如何bin部署sqlce4.0的ASP.NET mvc3网站
Mamboer · 2011-02-22 · via 博客园 - Mamboer

参考这里:

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!