Skip to content
December 11, 2010 / windperson

又一個很鳥蛋的Visual Studio 2010的bug

參考了這個說明,想要做ASP.Net 3.5 XML web service的unit test,結果出現下面這個Error Message:

The test adapter 'WebHostAdapter' threw an exception while running test 'HelloWorldTest'. The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost:1103/ASPNETWebService/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error. The remote server returned an error: (500) Internal Server Error.

靠背,又是甚麼在這專案裡根本沒有的鬼檔案VSEnterpriseHelper.axdSteaming mad

於是乎漫長的搜尋之後發現這個網址:
http://connect.microsoft.com/VisualStudio/feedback/details/541084/generated-asp-net-unit-tests-failing-with-requesting-http-localhost-nnnnvsenterprisehelper-axd-returned-an-erro
看來又是Visual Studio 2010的鳥蛋bug,總之,在那個要被測試的ASP.net 3.5 Web Service專案的Web.config設定檔的<runtime>…<runtime/>內容多加一行在其他子節點之前:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"/>

並且確定測試專案的測試程式碼裡[UrlToTest()]這個Attribute裡面指定的網址是該Web Service專案裡的〝dummy aspx page〞URL位址,就可以順利使用測試專案來對.net 3.5 web service做unit test。Thumbs up

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: