开发者

Asp.net Web Service Test Error

I'm just stuck within ASP.NET, I've created a Unit Test Class for test a blank Web Service (want to do TDD).

When I try to run the Web Service, it supposed to run and fail, but it fail to execute, it says:

The test ad开发者_高级运维apter 'WebHostAdapter' threw an exception while running test 'EnrollmentWSConstructorTest'. The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost:1032/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.

Any idea?


You may want to take a look at this link:

http://www.hanselman.com/blog/NUnitUnitTestingOfASPNETPagesBaseClassesControlsAndOtherWidgetryUsingCassiniASPNETWebMatrixVisualStudioWebDeveloper.aspx

I found it very helpful when I was on a project that wanted to add after-the-fact unit tests for web services, so spinning up instances of a web server were needed for testing.


For us I fixed this by opening the web.config of the site and changing this

<modules>
  <add name="HostAdapter" type="Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule, Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>

to this

<modules>
</modules>

or basically deleting the hostadapter module ... because visual studio will just automatically add it back anyways later

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜