简体   繁体   English

ASP.NET网站中的VS 2010 VSEnterpriseHelper.axd错误

[英]VS 2010 in ASP.NET Website, VSEnterpriseHelper.axd error

I have an ASP.NET website (.NET 4). 我有一个ASP.NET网站(.NET 4)。 I am trying to add Unit Testing (using Unit Testing Framework of VS 2010 ultimate) to code are located in the App_Code folder. 我试图将单元测试(使用VS 2010 Ultimate的单元测试框架)添加到位于App_Code文件夹中的代码中。

I have the following method in my unit test project: 我的单元测试项目中有以下方法:

[TestMethod()]
[HostType("ASP.NET")]
[AspNetDevelopmentServerHost("C:\\..\\MyProject", "/MyProject")]
[UrlToTest("http://localhost:45156/MyProject/Inicio.aspx")]
public void TestMethod1()
{
    Page page = TestContext.RequestedPage;
    Assert.IsTrue(false, "Test ran, at least.");
}

I have the following web.config in my ASP.NET website: 我的ASP.NET网站中有以下web.config:

<?xml version="1.0"?>
<configuration>
    <system.web>
        <xhtmlConformance mode="Strict"/>
        <authorization>
            <deny users="?"/>
        </authorization>
            <!--another tags like pages, httpRuntime, compilation, sessionState, trace and globalization-->
    </system.web>
</configuration>

I'm getting this exception: 我收到此异常:

"The test adapter 'WebHostAdpater' threw an exception while running test 'TestMethod1'. The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://127.0.0.1:45156/MyProject/VSEnterpriseHelper.axd' (required) returned an error: The remote server returned an error: (500) Internal Server Error..." “运行测试'TestMethod1'时,测试适配器'WebHostAdpater'引发异常。无法正确配置网站;获取ASP.NET进程信息失败。请求'http://127.0.0.1:45156/MyProject/VSEnterpriseHelper。 axd'(必需)返回了错误:远程服务器返回了错误:(500)Internal Server Error ...”

The page works as it should in a browser at the url: http://localhost:45156/MyProject/Inicio.aspx 该页面将在浏览器中的URL上正常运行:http:// localhost:45156 / MyProject / Inicio.aspx

This is very similar to the problem found here: - 500 Error Running Visual Studio ASP.NET Unit Test - Visual Studio 2010 Professional - Problem Unit-Testing Web Services - ASP.NET Performance Profiling 404/500 errors - VS2010 and ASP.NET unit test problems / WebHostAdapter exception - Unit Testing ASP.net Web Site Project code stored in App_Code 这与这里发现的问题非常相似:- 运行Visual Studio ASP.NET单元测试时出现500错误 -Visual Studio 2010专业版 -Web 服务单元测试问题 -ASP.NET性能分析404/500错误-VS2010 和ASP.NET单元测试问题/ WebHostAdapter异常 - 单元测试ASP.net网站项目代码存储在App_Code中

However, I haven't been found the solution for my project using the solutions than the similar problem. 但是,除了类似的问题外,还没有使用解决方案为我的项目找到解决方案。 I have spent a couple days having this error. 我已经花了几天的时间出现此错误。 I hope you can help me. 我希望你能帮助我。

我从VS论坛获得了针对此问题的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM