Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6549955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:09:25+00:00 2026-05-25T12:09:25+00:00

The scenario: Visual Studio 2010, ASP.NET web application Create a web service class and

  • 0

The scenario:

  • Visual Studio 2010, ASP.NET web application
  • Create a web service class and give it some WebMethod-attributed methods
  • Have Visual Studio auto-generate unit tests for the methods, by right-clicking in the class definition and choosing Create Unit Tests...
  • Note that the generated code for each test includes this boilerplate:

    // TODO: Ensure that the UrlToTest attribute specifies a URL to an ASP.NET page 
    // (for example, http://.../Default.aspx). This is necessary for the unit test to 
    // be executed on the web server, whether you are testing a page, web service, or 
    // a WCF service.
    [TestMethod]
    [HostType("ASP.NET")]
    [AspNetDevelopmentServerHost("C:\\...\\ProjectName", "/")]
    [UrlToTest("http://localhost:59733/")]
    public void MethodNameTest()
    
  • Add in Default.aspx to UrlToTest, as requested by the comment:

    [UrlToTest("http://localhost:59733/Default.aspx")]
    
  • Run all tests in the class

The problem:

Inconsistently, some tests fail with

The communication channel with ASP.NET could not be configured. Requested Service not found

Which tests fail and which tests pass can vary from run to run. There appears to be no pattern to the failures, but it’s never the case that all successfully run.

What’s going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:09:25+00:00Added an answer on May 25, 2026 at 12:09 pm

    Is it the case that the page you’ve specified in UrlToTest always performs a Response.Redirect on load? Because if it is, this will the the cause of the failures you’re seeing.

    Change the URL specified in UrlToTest to that of a page that does not perform a Response.Redirect, and your tests should run fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario : Web Site project under .NET 3.5 Visual Studio 2010 WCF Service reference
Scenario : I have an ASP.NET MVC application developed in Visual Studio 2008. There
Having issues getting jQuery to work in this scenario: Visual Studio 2010 .Net 4.0
I use the ASP.NET Development Web server (also known as the Visual Studio Development
I am currently playing around with VB.Net using Visual Studio 2010 (.Net 4.0) and
My scenario I'm using Visual Studio 2010 with Entity Framework 4.1 I have a
I recently setup a WCF service using Visual Studio 2010. The service is hosted
I know there have been some major improvements in Visual studio 2010 for debugging
Here is my scenario: I have a windows form designed in Visual Studio 2010.
I have a scenario where I am using a visual studio 2010 database project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.