關於 .Net and Visual Studio 2005 and Debugging Code

昨天身在大馬的小冠冠問我要不要接Case,有一個電子秤連結Database的案子要找人作。鑑於最近收入變少,股票與基金也賠錢。還有SonyStyle 台灣的夏季特賣會將要舉辦,想去帶一台TX27 回來用用。就答應它了。

原來是想使用C++ Builder 來開發Demo & Application 的,但是小冠冠說要考慮之後交給它維護的問題,所以就選了 .Net & C#,這個說實在的非常不熟,所以現在展開了學習,想不到光是一個 Debug就遇到了問題。

在Visual Studio 2005 裡面按下 Debug 後,會出現  "Error while trying to run project:Unable to start debugging 連結控制碼不正確" ,查了一下有幾個解決的方法

  • 在 Project Properties/Debug 裡面的 Enable the Visual Studio hosting process 取消
  • 或是將 Windows Service 的 Terminal Service 啟動(選自動或者手動啟動都行)
  • 還有一個方式是 Enable unmanaged code debugging

我選擇的方式是將 Terminal Services 啟動,原因來自底下的說明

根據 MSDN 的說明

http://msdn2.microsoft.com/en-us/ms185331.aspx


Visual Studio 
Hosting Process (vshost.exe) 

The hosting process is a feature in Visual Studio 2005 that improves debugging performance, enables partial trust debugging, and enables design time expression evaluation. The hosting process files contain vshost in the file name and are placed in the output folder of your project. For more information, see Debugging and the Hosting Process.

NoteNote

Hosting process files (.vshost.exe) are for use by Visual Studio 2005 and should not be run directly or deployed with your application..

Improved Debugging Performance

The hosting process creates an application domain and associates the debugger with the application. Performing these tasks can introduce a noticeable delay between the time debugging is started and the time the application begins running. The hosting process helps increase performance by creating the application domain and associating the debugger in the background, and saving the application domain and debugger state between runs of the application. For more information on application domains, see Application Domains.

廣告

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

%d 位部落客按了讚: