VS 2005 Converted Header causing error when publishing
After converting from Visual Studio 2003 to 2005, I have had several
issues with a header that is used throughout the project. The conversion
automatically created an abstract base class for the header in the
Migrated folder of the App_Code directory. One of the major problems
this caused was regarding the fact that I pass the header to a standard
error handling class to process the error and print an appropriate error
message in the header. This results in the following compilation error:
Error 107 Option Strict On disallows narrowing from type 'Header' to
type 'ASP.header_ascx' in copying the value of 'ByRef' parameter
'PageHeader' back to the matching argument.
So to get around this I cast the object to the ASP.header_ascx type it
is looking for and this allows it to build and run correctly. The
header_ascx refers to my header.ascx file, although I'm not sure how
this type ends up under the ASP namespace. Anyway, when I try to publish
the website, which I need to do to create the dll(s) necessary for
deploying I receive a build error for certain pages, ASP.header_ascx
type not found. It is odd that I receive this error when building to
publish but not when just building. If I take out the CType conversion
for certain pages the error seems to go away and builds fine, but if I
try taking it away for all pages then I receive the first error again.
Publishing error: Error 1 Type 'ASP.header_ascx' is not defined.
I have a smaller project that uses a similar header, where the
conversion created the stub the same way, but I have been able to get it
to build/publish correctly without casting the Header. (Although I did
run into the same problems originally)
I cannot find any differences between the way I have the pages
configured in the small project and in the larger one. And in the larger
project I cannot see any differences between the way the pages are
configured, where it can find ASP.header_ascx and those it cant
Has anyone run into similar problems/have any suggestions?
*** Sent via Developersdex http://www.developersdex.com ***