asp.netvb.netnamespacesnamespace-organisation

Why is this clearly visible symbol unresolvable?


I'm getting an ASP Error, according to Resharper, "Solution MembersOrderEntry.sln Project MembersOrderEntry MembersOrderEntry\segovias-abq\Default.aspx:1 Cannot resolve symbol 'segovias-abq'"

In the same Default.aspx file, there is a similar error, "Solution MembersOrderEntry.sln Project MembersOrderEntry MembersOrderEntry\segovias-abq\Default.aspx:1 Cannot resolve symbol '_Default'"

Why are these symbols ('segovias-abq' and '_Default') unresolvable? The project contains many files named Default.aspx, with Default.aspx.vb beneath them; most of them throw no errors. But after letting Resharper "fix" funky namespace (where it thought they were wrong), I'm getting four of these errors.

Why are the lion's share of the Default.aspx files able to resolve their parent file, but this one is not? As you can see here, the relationship between the failing one and others are the same (a folder name, with Default.aspx beneath that, and Default.aspx.vb beneath that):

enter image description here

Seashore, SimonLeeman, Stern, Weyand, and many others all work fine.

The entire contents of the failing Default.aspx is:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="segovias-abq._Default" title="Web Order Entry" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Order Entry Login Page</title>
</head>
<body>
<form id="form1" runat="server">
    <div>
    </div>
</form>
</body>
</html>

...and the Default.aspx.vb for it is:

Partial Class _Default
    Inherits Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Session("SelectedMenu") = "Home"
        Response.Redirect("../Login.aspx?MemberNo=B1212")
    End Sub
End Class

OTOH, the entire contents of one of the non-failing Default.aspx is:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Weyand._Default" title="Web Order Entry" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Order Entry Login Page</title>
</head>
<body>
<form id="form1" runat="server">
    <div>
    </div>
</form>
</body>
</html>

...and its Default.aspx.vb is:

Namespace Weyand
    Partial Class _Default
        Inherits Page

        Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
            Session("SelectedMenu") = "Home"
            Response.Redirect("../Login.aspx?MemberNo=031")
        End Sub
    End Class
End NameSpace

IOW, except for the namespaces, they seem to be identical. But even when I added what would seem to be the one expected:

Namespace segovias-abq

...it changed nothing; I still get, "Cannot resolve symbol 'segovias-abq'"


Solution

  • ReSharper removes hyphens or underscores from namespaces when making the namespace names match their directory paths. During a refactoring, ReSharper will not look at string references unless you allow it.

    I believe when you refactored, the hyphen was removed form the segovias-abq namespace but that namespace change does not appear to have been corrected in this portion of Default.aspx:

    Inherits="segovias-abq._Default"