Reputation: 5551
I have a debug=true enabled deployment of my website on a server somewhere. When I open it in a browser on the server, I get a stacktrace for my errors. When I navigate to that page from another machine, I get squat. How do I enable the stacktraciness for remote machines?
EDIT
TO RECREATE
Create a vanilla Single Page App in Visual Studio and migrate everything to your database, web deploy that to Windows Server server somewhere with debug=true, attempt to debug connection string woes, fail as browsing the site from localhost on the server gives different behavior than browsing the site from an external machine.
Upvotes: 0
Views: 2519
Reputation: 61849
This feature is by design, so that the internals of your program don't get displayed to users - who might be frightened by them and think they have broken the internet - and malicious individuals who might use the information to try and hack at your data (e.g. if it exposes info about the database). It enables you instead to display a user-friendly error message of your choice.
However, if you want to override this feature in your non-live environments to make testing easier, modify your web config as follows, to set "customErrors" to "Off":
<system.web>
...
<customErrors mode="Off"/>
...
</system.web>
More info is here: https://msdn.microsoft.com/en-gb/library/h0hfz6fc(v=vs.100).aspx
I would strongly advise you never to do this in a live environment. Instead, handle exceptions and log them to your server's event log, so you can trace any issues.
Upvotes: 3