顯示具有 Visual Studio 標籤的文章。 顯示所有文章
顯示具有 Visual Studio 標籤的文章。 顯示所有文章

2018/11/30

[Visual Studio] 解決專案找不到參考的元件 System.Web.Mvc, System.Web.Http 的問題

發生的原由


專案是從 Git 儲存庫複製下來的,依照原開發者的專案設置,在載下來之後,重新建置方案會把相關的 packages 從 NuGet 下載回來,通常建置過也不會有什麼大問題,但是就遇到了找不到參考元件的錯誤

遇到的問題


專案是以三層式架構來撰寫

其中在 MVC 的網站專案出現:找不到參考的元件 System.Web.Http

而某一個 Library 專案出現:找不到參考的元件 System.Web.Mvc


錯誤顯示如下:



在專案會看到參考出現驚嘆號



看起來版本好像也不在我的開發本機裡

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.

2009/02/12

.NET WindowForms 選單快速鍵的建立

MenuStrip 中的選單快速鍵做法
在選單名稱後加入 & 再加快速鍵字母即可

e.g.
工具 (&T) ==> 在視窗將會顯示 "工具 (T)"

若要加入分隔線, 則直接在 Text 輸入值 "-"

2008/12/30

加速開啟 VS2008 及 SQL Server Management Studio

在捷徑的目標位置後加上 -nosplash

步驟:
  1. 在捷徑圖示上按右鍵選 "內容"
  2. 選擇 "捷徑" 標籤
  3. 在 "目標" 內容最後加上 -nosplash
    例如: "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" -nosplash
  4. 套用/確定, 完成設定

如此在開啟時,便不會顯示開始的歡迎視窗 :)

2008/11/14

Visual Studio - JScript Editor 支援 -vsdoc.js IntelliSense 文件

VS2008 愈來愈聰明了!

KB958502 - JScript Editor support for “-vsdoc.js” IntelliSense documentation files

hotfix 安裝需求:
Visual Studio 2008 SP1
Visual Web Developer 2008 Express edition with SP1

執行:
若在文件中引入 javascript 檔案, 命名如: abc-1.2.3.js
VS2008 將會自動找尋對應的 -vsdoc.js 文件 (如: abc-1.2.3-vsdoc.js) 做為 intellisense 的文件來源

也就是說只要準備 abc-1.2.3.js 及 abc-1.2.3-vsdoc.js 兩個檔案
引入時只需引入 abc-1.2.3.js 檔

在外部的 js 參考也僅需加入原檔的參考, 而不需要輸入完整的 intellisense 參考檔

2008/10/12

[jQuery] jQuery Intellisense in VS2008

Some articles about jQuery Intellisense in VS2008


Common Use:
<script src="js/jquery-core.js" type="text/javascript"></script>
<script src="js/jQuery.intellisense.js" type="text/javascript"></script>

While executing js code, it's better command out intellisense script. Otherwise, browser won't diplay correct results.

In separated js file, use:
/// <reference path="js/jQuery.intellisense.js">

2008/04/26

VS2008 + PHP

Visual Studio is a great IDE and editor, I use it at work for doing .NET projects. However, I would also like to use it to deal with my PHP projects, since it has better debugging function for JavaScript in VS2008.

I do not really need php IDE but code coloring.

Here is a great tool to help me out!

Visual Studio 2008 and PHP Coloring

Simple tool but great!!