更新后,Visual Studio .NET项目崩溃了

时间:2019-02-05 23:32:43

标签: c# .net visual-studio

我更新了Visual Studio,正在从事C#/ .NET项目。该程序在本地计算机上运行良好,但是当我在线提交时,该项目因以下错误而崩溃:

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


    <!-- Web.Config Configuration File -->

    <configuration>
        <system.web>
            <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
        </system.web>
    </configuration>

我不确定为什么会发生这种情况,但是我想这与Visual Studio的新版本有关,并且我必须在项目中手动对其进行更改以表明它正在运行最新版本。有人有猜测吗?

1 个答案:

答案 0 :(得分:0)

这不是Visual Studio问题,而是网站内部的问题。要查看发生了什么,请从mode="Off"更改为mode="On"并重新启动网站:

<configuration>
    <system.web>
        <customErrors mode="On" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>