環境:Visual Studio 2010 ASP.NET MVC3
手動添加: 下載地址:http://twitter.github.com/bootstrap/
一個js,兩個css,兩張圖
js 文件: •bootstrap.min.js
CSS 文件: •bootstrap.min.css •bootstrap-responsive.min.css
image 文件: •glyphicons-halflings.png •glyphicons-halflings-white.png
注: •bootstrap.js •bootstrap.css •bootstrap.responsive.css 是帶 min 關鍵字的文件的對應源碼,min 是其壓縮文件。我們在項目中只需要添加帶 min 關鍵字的文件。
或者使用 NuGet Package Manager 加入到項目
應用:
_Layout.cshtml 中添加:
CSS:
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/bootstrap-responsive.min.css")" rel="stylesheet" type="text/css" />
JS:
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
安裝了VS2010,打開工程提示如下:
The 'Microsoft.Data.Entity.Design.BootstrapPackage.BootstrapPackage, Microsoft.Data.Entity.Design.BootstrapPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' package did not load correctly.The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:/Users/Administrator/AppData/Roaming/Microsoft/VisualStudio/10.0/ActivityLog.xml'
連續卸載重裝不湊效,在網上看見有位大神發了此貼,特次表示感謝,希望更多的人從這個泥潭中走出來,幾個晚上傷不起啊傷不起
解決辦法:
1. 卸載VS2010(只卸載VS2010即可,SQLServer那些都可以不動)
2. 卸載完畢後執行以下命令(無需重啟):
32位Windows:
reg delete HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/10.0/AutoLoadPackages/{adfc4e66-0397-11d1-9f4e-00a0c911004f} /v {7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB} /f
reg delete HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/10.0/AutoLoadPackages/{93694fa0-0397-11d1-9f4e-00a0c911004f} /v {7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB} /f
reg delete HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/10.0/Packages/{7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB} /va /f
64位Windows:
reg delete HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/VisualStudio/10.0/AutoLoadPackages/{adfc4e66-0397-11d1-9f4e-00a0c911004f} /v {7A4E8D96......余下全文>>
vs2010安裝後就自帶了mvc2