Local file paths showing in stack traces

A

AbsolutG

This is not exactly a show-stopper but I am concerned about it. I was
hoping someone could shed some light on it.

I have a web service that I've been programming on my local machine
using Visual Studio 2008 for a while. Whenever it's ready for
deployment I simply upload it to a web server using the Publish tool
in VS2008. Client applications running from other machines (neither
mine, nor the server) consume the web service from the server just
fine.

The thing that is making me nervous, though, is that whenever those
clients get an exception from my web service and look at the stack
trace, they see the complete path of the code files in my local
machine!

An example would be that I have a file in my web service project in
the following path:
C:\Documents and Settings\Administrator\My Documents\Visual Studio
2008\Projects\MyWebService\MyWebService\Service.asmx.cs

When the clients get an exception, in the stack trace they see
something like this:
etc...
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions
o)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions
options)
at System.Xml.Linq.XDocument.Load(XmlReader reader)
at C:\Documents and Settings\Administrator\My Documents\Visual Studio
2008\Projects\MyWebService\MyWebService\Service.asmx.cs:line 57
etc...

This means (I believe) that somehow, somewhere, the web service I'm
publishing to the web server is saving information about where my
local files are located in my hard drive.

Is there a way to avoid having this information from being shown?

Please don't pay attention to the exception handling. That is not what
worries me right now. What worries me is that the web service seems to
have a reference to my local files, even though the it is running on
the web server.

Thanks!
 
J

John Saunders

AbsolutG said:
The thing that is making me nervous, though, is that whenever those
clients get an exception from my web service and look at the stack
trace, they see the complete path of the code files in my local
machine! ....
Is there a way to avoid having this information from being shown?

Is this in a debug build or a release build? That information should not be
present in a release build. In fact, I believe that information is only kept
in the .PDB files.
 
A

AbsolutG

Is this in a debug build or a release build? That information should not be
present in a release build. In fact, I believe that information is only kept
in the .PDB files.

You are right!

I was using the debug build so I tried to use the release build as you
said but it didn't make any difference at first; the paths were still
showing. I then checked on the web server and noticed that the pdb
file was still published, even though I set the configuration to use
the release build and the Publish tools deletes all the files in the
server before copying the files needed. I then deleted the pdb file
manually and tried again. The paths did not show!

As you said, the path information seems to be stored in that pdb file.
Problem is that I've been using the Publish tool from VS2008 to move
the files to the server. Is there a way to avoid having the pdb file
copied when publishing the project? Or should I simply move the files
manually to the server and forget about the Publish tool?

Thanks!
 
J

John Saunders

AbsolutG said:
You are right!

I was using the debug build so I tried to use the release build as you
said but it didn't make any difference at first; the paths were still
showing. I then checked on the web server and noticed that the pdb
file was still published, even though I set the configuration to use
the release build and the Publish tools deletes all the files in the
server before copying the files needed. I then deleted the pdb file
manually and tried again. The paths did not show!

As you said, the path information seems to be stored in that pdb file.
Problem is that I've been using the Publish tool from VS2008 to move
the files to the server. Is there a way to avoid having the pdb file
copied when publishing the project? Or should I simply move the files
manually to the server and forget about the Publish tool?

If you change your build to not build the PDB files, then I guarantee they
won't be published.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top