2013/12/06

Visual Studio 2013 開啟舊 MVC 2 專案


用 Visual Studio 2013 開啟過去舊的 ASP.NET MVC 2 專案發生無法正常開啟

開啟 MVC 專案裡的 *.vbproj 或 *.csproj

找到 ProjectTypeGuids 標籤內容如下:


    {F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}


將 {F85E285D-A4E0-4152-9332-AB1D724D3325} 移除

對照 MVC 版本移除對應的 Guid:

  • ASP.NET MVC 1: {603c0e0b-db56-11dc-be95-000d561079b0}
  • ASP.NET MVC 2: {F85E285D-A4E0-4152-9332-AB1D724D3325} (本範例)
  • ASP.NET MVC 3: {E53F8FEA-EAE0-44A6-8774-FFD645390401}
  • ASP.NET MVC 4: {E3E379DF-F4C6-4180-9B81-6769533ABE47}
 重載之後即可開啟, 並重新編譯~ 完成!!

筆記~ 也許幫得著跟我遇到一樣問題的朋友


Reference:

How do I open an old MVC project in Visual Studio 2012 or Visual Studio 2013?

2013/10/15

[IIS] Andorid .apk file MIME type settings

APK files are ZIP file formatted packages based on the JAR file format, with .apk file extensions. The MIME type associated with APK files is application/vnd.android.package-archive.

Extension: .apk
MIME type: application/vnd.android.package-archive

Wikipedia: APK file format

2013/10/14

[Visual Studio] 原始碼控制 Source Control 變更

在開發階段原本使用 SVN 來做原始碼控制, 開發半途開始接觸 Git, 當下並沒有太多的變更及需要 Commit, 決定變更改用 Git 來做原始碼控制.

每每到 工具 -> 設定 -> Source Control 變更成 Git 時, 由於原先設定 SVN 造成無法直接變更.

解決方法:

1. 關閉現行專案
2. 用文字編輯器開啓專案 Solution 檔 *.sln 檔案, 將下列區塊移除即可

 GlobalSection(SubversionScc) = preSolution
  Svn-Managed = True
  Manager = AnkhSVN - Subversion Support for Visual Studio
  EndGlobalSection

3. 重啟專案
4. 重新選擇 Source Control 的 plug-in

2013/09/18

[JavaScript] 回上一頁 script

 完整可用, 並已測試於下列瀏覽器: IE, FF, Safari, Chrome, Opera, Maxthon
<a href="#" onclick="javascript:window.history.back(-1);return false;"Back</a>
記得最終的 return false; 一定要加

2013/09/16

[SQL Server] 無法安裝資料庫圖表支援物件

在 SQL Server 建立各資料表間的關連, 最好用的功具就是 "資料庫圖表"

而今日將資料庫掛載在不同的 SQL Server 主機卻出現以下錯誤訊息:
無法安裝資料庫圖表支援物件,因為此資料庫沒有有效的擁有者。若要繼續,請先使用 [資料庫屬性] 對話方塊的 [檔案] 頁面,或使用 ALTER AUTHORIZATION 陳述式,將資料庫擁有者設定為有效的登入,然後再加入資料庫圖表支援物件。

要解決此問題, 請在該資料庫上按右鍵->屬性
選擇檔案, 並在 "擁有者" 的地方指定一個具有效登入的使用者即可

2013/05/16

JCrop - Fixing strange bug in Safari and Chrom

This is ok in Firefox, but somehow it works weird in Chrome.

$.Jcrop($('#cropbox'),options);

Doing below changes. All work fine in IE, Firefox, Safari, and Chrome!

$('#cropbox').Jcrop(options); 
var jcrop = $('#cropbox').data('Jcrop'); 
jcrop.setOptions(newOptions);

Good to go forward!

2012/01/31

32-bit DLLs 使用於 64-bit OS 發生 BadImageFormatException 錯誤之解決方法

今日在 64-bit 的主機使用 VS2010 編譯一支過去寫的程式
突然出現 BadImageFormatException 的錯誤訊息
原程式使用 VS2008 編譯, 當時好像沒有出現該錯誤, 或是我原本使用的 32-bit 主機來編譯
Anyway, 只是因為有一小段 code 要修改, 且把整個程式升級成 VS2010 的專案才浮現的錯誤
還好在看完 MSDN 上的 troubleshooting 之後, 動手變更編譯的 Target CPU: Any CPU 改成 x86 就搞定了



參考 MSDN 的分享:

32-bit DLLs on a 64-bit OS

This exception can occur when a .NET application running on a 64-bit platform attempts to load a DLL that does not support native 64-bit execution. If the application is built in platform-agnostic (i.e. "Any CPU") mode, it will launch in 64-bit mode on the host operating system, leading to this problem. To fix this, you can force the application to run in 32-bit mode by compiling for x86 architecture explicitly, forcing the program to launch in WoW64 mode on the 64-bit system, and allowing the 32-bit DLL to be accessed.