Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does .net mvc 4 web api service show local machine's path in exception message?

The setup

I have deployed a mvc 4 web api service to our web server, using the web deploy method in Visual Studio 2010.

The problem

When an exception is thrown, it lists my local machine on which the service was developed in the exception message.

Example:

... at System.Data.SqlClient.SqlConnection.Open()\r\n at ImageApp_REST_Services.Repositories.ImageLinkRepository.Get(String userId) in C:\localuser\documents\visual studio 2010\Projects\ImageApp_REST_Services\ImageApp_REST_Services\Repositories\ImageLinkRepository.cs:line 57\r\n

Does this mean the service is running on my local machine?

or

Is this just carried over from when I performed the web deploy?

In any event, how can I fix this so that the web server where the service is deployed is shown in the exception message and not my local development machine???

Thanks!

like image 243
Zengineer Avatar asked Aug 30 '13 15:08

Zengineer


1 Answers

When you deploy the application, you usually deploy PDB files with it. the PDB files contain debugger symbols that allow for line numbers to be indicated... They are generated at the time that you built/compiled the app for deployment/installation, so they reference your local path.

PDB information

like image 127
Haney Avatar answered Oct 16 '22 10:10

Haney