0
votes

Using VS2013, I have a VB .NET 4.0 web application that runs fine locally, but when I try to publish it with pre-compile, I get the error /Controls/IDOI_Header.ascx(1,0): Error ASPPARSE: The file '/Controls/IDOI_Header.ascx.vb' does not exist.

If I change the "CodeFile=" directive to "CodeBehind=" I get "cannot load type IDOI_Header"

The file /Controls/IDOI_Header.ascx.vb does indeed exist (I've checked the .vbproj, the file system and of course the tree control.) The code in the .vb file is:

Partial Class IDOI_Header Inherits System.Web.UI.UserControl End Class

The user controls are only referred to in a master file like so:

[snip]

    <div id="Wrapper">
        <div id="HeaderSection">
            <idoi_header:idoi_header ID="Idoi_header" runat="server" />
        </div>

[snip]

I have renamed the files (I read that the _ might have implications) and I've deleted the files and re-added them and made sure they're in the source control. Even our leader developer is baffled.

Any suggestions?

1
Are there any references that might be broken? - webdad3
Is this a website project or a web application project? If it's a website project, leave it as CodeFile. If it's a Web Application Project, make sure it's CodeBehind. Also, make sure that the Inherits in the @Page directive exactly matches the full namespace and class name. - Mark Fitzpatrick
Here's the original: <%@ Control Language="VB" AutoEventWireup="false" CodeFile="IDOI_Header.ascx.vb" Inherits="IDOI_Header" %> When I change it to <%@ Control Language="VB" AutoEventWireup="false" CodeBehind="IDOI_Header.ascx.vb" Inherits="IDOI_Header" %> I get "Could not load type IDOI_Header" Here's the codebehind: Partial Class IDOI_Header Inherits System.Web.UI.UserControl End Class even if I explicitly set a namespace. One other bit of fun, this only happens when I pre-compile for Release. pre-compile for Debug works (at least most of the time...) - Duston
Forgot to mention...it's a Web Application, not a website (there's a .vbproj file). - Duston

1 Answers

0
votes

I figured out the "how" but not the "why." I had originally added these user controls (and a couple master pages as well) to the project using Add->Existing Item. I found that if I delete them, then Add->New Item, and then paste the in code (both asp markup and the .vb codebehind) from the files I had originally added in, it worked.

So now the question is, what's different between Add->Existing and Add->New that would explain this?