Bad path reference in dll moving from Dev to Live server

Topics: ASP.NET 2.0
Feb 2, 2010 at 9:40 PM


I'm getting a path error causing an unhandled exception on a blog page.

After moving the blog code from the local development server to the live server I am seeing a reference in the BlogEngine.Core.dll on the live server still pointing to my local dev server:

eg. "\\dev01\Websites\blogs\BlogEngine.Core\BlogEngine.Core\obj\Debug\BlogEngine.Core.pdb

I believe a former employee may have made a change to the code and recompiled the dll but I can't find a reference in the source to the local dev, "dev01" anywhere in the source.   

Where should I be looking to change the path that is using "dev01" to use my live servers path???

I've tried finding this on my own and seem to be stuck.  Any help would be greatly appreciated.  Thanks.

Feb 2, 2010 at 11:05 PM

The text you're seeing "\\dev01\Websites...", is this appearing in the error message or error details?  Or if not, where are you seeing it?

I'm actually not sure, but I think sometimes paths like this are maybe included in some meta data for the compiled files, but they aren't actually used for executing code.  The PDB files are files that contain debugging information.  Probably because an error is occurring, the code is trying to find the debugging information in the PDB file.

I would probably concentrate on the path error you're getting.  What error message are you getting anyways?  If you can post all the details you're seeing, that will help.

Feb 2, 2010 at 11:48 PM

Thanks Ben.

The text appeared in the Application Event Log on a Windows 2008 Server running IIS7. (included below)

I did a search on the live server for any reference to "dev01", which is our local development server, on the Live server and I could only find reference to it in the actual dll and the pdb file.  Not sure how this text shows up in a dll but I was thinking maybe in the past we made a change on the local dev server and compiled the source to create the dll and it had a reference to this path either by our own doing or by a default setting in Visual Studio and then this dll was moved to the Live server with the local dev server path still intact.

Does the following event log message help in any way?


Event code: 3005

Event message: An unhandled exception has occurred.

Event sequence: 49

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/4/ROOT/blogs-1-129096256064619953

Trust level: Full

Application Virtual Path: /blogs

Application Path: D:\Websites\\BlogEngine.Web\

Machine name: SERVERNAME1

Process ID: 11064

Process name: w3wp.exe


Exception type: NullReferenceException

Exception message: Object reference not set to an instance of an object.

Request URL:

Request path: /blogs/foaf.axd

User host address: x.x.x.x

Is authenticated: False

Authentication Type:


Thread ID: 16


Is impersonating: False

Stack trace: at BlogEngine.Core.Web.HttpHandlers.Foaf.WriteFoaf(HttpContext context, String name) in \\dev01\Websites\\BlogEngine.Core\Web\HttpHandlers\Foaf.cs:line 108

at BlogEngine.Core.Web.HttpHandlers.Foaf.ProcessRequest(HttpContext context) in \\dev01\Websites\\BlogEngine.Core\Web\HttpHandlers\Foaf.cs:line 61

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Feb 3, 2010 at 12:10 AM

That's an error occurring in foaf.axd when someone tries going to that URL ( and a "Profile" isn't setup for either the user requested (which in this case there doesn't appear to be a requested user) or there isn't a profile setup for the 'first' user (an arbitrary decision -- the first user in the list of users).  I was able to reproduce this error on my computer.  The code in foaf.axd is incorrectly making the assumption that a profile always exists for each user.

I wouldn't worry about this error.  It's something that should be fixed, but isn't critical.  You can avoid the error by going to the Profiles tab in the control panel, and make sure there's a Profile for each user in the dropdown list.  All you need to do is just select each user, click the 'switch to' link, and then probably just fill in any of the pieces of information (like Name), and click Save.  This will ensure each user has a profile.

Feb 3, 2010 at 12:30 AM

Now I'm probably into another mess but when I try to save the profile I get:


This page can't be displayed due to a security violation. Contact support for additional information

The incident ID is: 0.


From some things I read maybe I do not have permissions set correctly on some folders.  ASPNET user for the App_Data folder is not there???

Feb 3, 2010 at 12:36 AM

Now-a-days, in most cases, it's the Network Service account that needs Write permissions on the App_Data folder.

I'm not sure if file permissions are the problem here.  But it could be.  I would try granting the Network Service account Write or Full permissions.

If you're interested, you can use the code below to determine what account the blog is running under.  You would want to create a new file with an ASPX extension (like account.aspx), put the code below into it.  Put the file on your site, and then pull up this page (account.aspx) in your browser.


<%@ Page Language="C#" %>
<%@ Import Namespace="System.Security.Principal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            litAccount.Text = WindowsIdentity.GetCurrent().Name;

<html xmlns="">
<head id="Head1" runat="server">
    <title>What account is ASP.NET running as ?</title>
    <form id="form1" runat="server">
        The account ASP.NET is running as: <asp:Literal ID="litAccount" runat="server"></asp:Literal>

Feb 3, 2010 at 1:51 AM

Thanks for the code.  I'll file that tool away.

It shows that it is running under NT AUTHORITY\NETWORK SERVICE.

I checked and security for the folders in question under the NETWORK SERVICE user has write permissions.

I'll check around more tomorrow but I thank you very much for your time Ben.

Feb 3, 2010 at 5:08 AM

The last error message you posted has strange / unusual verbiage.  Does that error message appear in the browser, or in the Event Viewer?

In particular, "The incident ID is: 0" is not something I've seen before.  I wonder if that's coming from some external component like URL scan or something like this.

In fact, according to the link below, that message is *probably* coming from a firewall: