Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8507811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:58:30+00:00 2026-06-11T02:58:30+00:00

In the YSOD below, the stacktrace (and the source file line) contain the full

  • 0

In the YSOD below, the stacktrace (and the source file line) contain the full path to the source file. Unfortunately, the full path to the source file name contains my user name, which is firstname.lastname.

I want to keep the YSOD, as well as the stack trace including the filename and line number (it’s a demo and testing system), but the username should vanish from the sourcefile path. Seeing the file’s path is also OK, but the path should be truncated at the solution root directory.

(without me having to copy-paste the solution every time to another path before publishing it…)

Is there any way to accomplish this ?

Note: Custom error pages aren’t an option.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:58:32+00:00Added an answer on June 11, 2026 at 2:58 am

    Never mind, I found it out myself.
    Thanks to Anton Gogolev’s statement that the path is in the pdb file, I realized it is possible.

    One can do a binary search-and-replace on the pdb file, and replace the username with something else.

    I quickly tried using this:
    https://codereview.stackexchange.com/questions/3226/replace-sequence-of-strings-in-binary-file
    and it worked (on 50% of the pdb files).
    So mind the crap, that code-snippet in the link seems to be buggy.

    But the concept seems to work.

    I now use this code:

        public static void SizeUnsafeReplaceTextInFile(string strPath, string strTextToSearch, string strTextToReplace)
        {
            byte[] baBuffer = System.IO.File.ReadAllBytes(strPath);
            List<int> lsReplacePositions = new List<int>();
    
            System.Text.Encoding enc = System.Text.Encoding.UTF8;
    
            byte[] baSearchBytes = enc.GetBytes(strTextToSearch);
            byte[] baReplaceBytes = enc.GetBytes(strTextToReplace);
    
            var matches = SearchBytePattern(baSearchBytes, baBuffer, ref lsReplacePositions);
    
            if (matches != 0)
            {
    
                foreach (var iReplacePosition in lsReplacePositions)
                {
    
                    for (int i = 0; i < baReplaceBytes.Length; ++i)
                    {
                        baBuffer[iReplacePosition + i] = baReplaceBytes[i];
                    } // Next i
    
                } // Next iReplacePosition
    
            } // End if (matches != 0)
    
            System.IO.File.WriteAllBytes(strPath, baBuffer);
    
            Array.Clear(baBuffer, 0, baBuffer.Length);
            Array.Clear(baSearchBytes, 0, baSearchBytes.Length);
            Array.Clear(baReplaceBytes, 0, baReplaceBytes.Length);
    
            baBuffer = null;
            baSearchBytes = null;
            baReplaceBytes = null;
        } // End Sub ReplaceTextInFile
    

    Replace firstname.lastname with something that has equally many characters, for example “Poltergeist”.

    Now I only need to figure out how to run the binary search and replace as a post-build action.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the common ASP.NET YSOD error. Here is the full error page
If I have a an app which relies on a .dll which contains my
Earlier today we experienced a YSOD on one of our MVC sites running on
I built up this regex at http://regextester.com to parse YSOD but VS is complaining
Question: I want to implement a sessionAccess class, which throws a SessionExpired-Exception when an
I have an MVC3 project for which I use NinjectMVC3 for dependency injection -
How can I use an interface (from which classes implement) in an XML web
I've an MVC 3 web app in which I'm using HandleError Action Filter for
I want to display the YSOD when it would be providing useful information during
When I have just one <%@Register %> line in my page, it loads fine.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.