Page directive complains that Language="vb" does not match the vb in CodeFile file

Last post 12-11-2007 5:48 PM by jjamjatra. 0 replies.

Sort Posts:

  • Page directive complains that Language="vb" does not match the vb in CodeFile file

    12-11-2007, 5:48 PM
    • Member
      163 point Member
    • jjamjatra
    • Member since 07-27-2004, 9:25 AM
    • Fairfax, Virginia
    • Posts 185

    I am getting compile time errors like this (yet - fortunately the project still executes correctly):

    1. Unrecognized namespace 'uc1'.
    2. The language referenced by the 'Language' attribute is not supported by Visual Studio IntelliSense and statement completion. Changing the language name when the file is open requires that you close and re-open the file.
    3. The language of the file referenced by the 'CodeFile' attribute does not match the language specified by the 'Language' attribute in the current file.

     Yet, here is the source of this little file:

     

    <%@ Page Language="vb" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <%@ Register src="PickStateCounty.ascx" TagName="PickStateCounty" TagPrefix="uc1" %>
    
    <!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>2.8.1 version (MDWEB) - Telerik Test Case for RadCombo v2.8.1 using my cookie routines </title>
        
        <script src="Scripts/global.js"              type="text/javascript"></script>
        <script src="Scripts/typeDetection.js"       type="text/javascript"></script>
        <script src="Scripts/TrimStrings.js"         type="text/javascript"></script>
        <script src="Scripts/cookieHandler.js"       type="text/javascript"></script>
    </head>
    <body>
        <form id="form1" runat="server">
        
        <div>
        
            <uc1:PickStateCounty id="PickStateCounty1" runat="server">
            </uc1:PickStateCounty>
            
        </div>
        </form>
    </body>
    </html>
    

     And the corresponding CodeFile named default.aspx.vb is simply:

     

    Partial Class _Default
        Inherits System.Web.UI.Page
    
    End Class
    

    This is just a small web app project that I copied from my localhost running XP to a remote (public access) server to give someone outside our firewall access. Both instances of Visual Studio are the same level - Version 8.0.50727.762  (SP.050727-7600). I've gone through the Tools->Options dialog and compared that all choices are the same. Properties are slightly different:

    • the project on my XP machine is configured to use Visual Studio Development Server
    • the project on my Win 2003 Server machine is configured to use IIS  

    Has anyone seen this sort of condition before? Strange that ignoring the build errors by just running the project works OK.

    Two more possible clues but they are weird:

    • the Visual Studio buttons in my XP project look a bit "3D" with rounded edges
    • the same buttons in the problem project look "flat" with squared edges 

     If I right-mouse on the .aspx file in Source view, I should see a choice called "view code". In my problem project that is always a disabled choice.

     

    John
Page 1 of 1 (1 items)