Note that there are some explanatory texts on larger screens.

plurals
  1. PO500 Error Running Visual Studio ASP.NET Unit Test
    primarykey
    data
    text
    <p>I have the following method in my unit test project:</p> <pre><code> [TestMethod] [HostType("ASP.NET")] [UrlToTest("http://localhost:3418/Web/SysCoord/ChooseEPA.aspx")] [AspNetDevelopmentServerHost("%PathToWebRoot%")] public void TestMethod1() { Page page = TestContext.RequestedPage; Assert.IsTrue(false, "Test ran, at least."); } </code></pre> <p>I'm getting this exception:</p> <p>The test adapter 'WebHostAdapter' threw an exception while running test 'TestMethod1'. The web site could not be configured correctly; getting ASP.NET process information failed. Requesting '<a href="http://localhost:3418/SysCoord/VSEnterpriseHelper.axd" rel="noreferrer">http://localhost:3418/SysCoord/VSEnterpriseHelper.axd</a>' returned an error: The remote server returned an error: (404) Not Found. The remote server returned an error: (404) Not Found.</p> <p>The page works as it should in a browser at the url: <a href="http://localhost:3418/Web/SysCoord/ChooseEPA.aspx" rel="noreferrer">http://localhost:3418/Web/SysCoord/ChooseEPA.aspx</a>. </p> <p>This physical path is: C:\ESI\HR_Connect2\BenefitChangeSystem\Application_DEV\Web\SysCoord.</p> <p>Any ideas would be appreciated.</p> <p><strong>Update 1</strong></p> <p>Added the following to my web.config file per this article. Also made the web.config writable and killed/restarted the development web server. No change in behavior.</p> <pre><code>&lt;location path="VSEnterpriseHelper.axd"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow users="*"/&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; </code></pre> <p><strong>Update 2</strong></p> <p>Changing the AspNetDevelopmentServerHost attribute to the equivalent of [AspNetDevelopmentServerHost("%PathToWebRoot%\solutionfolder\webfolder", "/webfolder")] resolved the 404 problem.</p> <p>Unfortunately the test began to return a 500 error instead. Progress, but not much. Trial and error with a clean project led to the conclusion that references to custom classes in the of the web.config were causing the problem.</p> <p>For example:</p> <pre><code> &lt;profile enabled="true" defaultProvider="MyProfileProvider"&gt; &lt;providers&gt; &lt;add name="MyProfileProvider" connectionStringName="ProfileConnectionString" applicationName="/MyApp" type="System.Web.Profile.SqlProfileProvider"/&gt; &lt;/providers&gt; &lt;properties&gt; &lt;add name="Theme" type="String" defaultValue="Default"/&gt; &lt;add name="LastLogon" type="DateTime"/&gt; &lt;add name="LastLogonIp" type="String"/&gt; &lt;!-- &lt;add name="EmployeeSearchCriteria" type="MyApplicationFramework.Profile.EmployeeSearchCriteria"/&gt; &lt;add name="DocumentSearchCriteria" type="MyApplicationFramework.Profile.DocumentSearchCriteria"/&gt; --&gt; &lt;/properties&gt; &lt;/profile&gt; </code></pre> <p>With the criteria types above commented out the test ran fine. With them uncommented, the 500 error was returned.</p> <p>Anyone had a similar problem in the past?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload