Publish Web Site Error - file 'src' is not a valid here because it doesn't expose a type

Last post 02-15-2007 1:16 PM by SWarren. 3 replies.

Sort Posts:

  • Publish Web Site Error - file 'src' is not a valid here because it doesn't expose a type

    02-15-2007, 11:40 AM
    • Contributor
      5,028 point Contributor
    • mkamoski
    • Member since 07-04-2002, 8:05 PM
    • ZULU-0500
    • Posts 1,376

    All --

    Please help.

    When I use >Build, >Publish Web Site, I keep getitng the following compile time erors (CTEs)...

    Error 1 The file 'src' is not a valid here because it doesn't expose a type. C:\Code\Abc\WebPartUserControls\Abc.WebPartUserControls.Core\Default.aspx 3 

    Error 2 Unknown server tag 'uc1:urltester'. C:\Code\Abc\WebPartUserControls\Abc.WebPartUserControls.Core\Default.aspx 12 

    Why is this happening and what can be done to prevent it from happening?

    Please advise.

    Here are some details about the project.

    1. The project was created with Microsoft Visual Studio 2005 Version 8.0.50727.762  (SP.050727-7600).
    2. The project was created by using >File, >New, >Web Site, Location="File System".
    3. The project has a single ASPX page and a single User Control, both of which use the code-behind method of coding.
    4. The ASPX page has the User Control on it.
    5. The project compiles fine with no CTEs using >Build, >Build Solution.
    6. The project runs fine in Debug mode from the IDE and the User Control works as expected.
    7. The options used for >Build, >Publish Web Site, are--
      TargetLocation="C:\PrecompiledWeb\MyWeb",
      Updatable = unchecked,
      Fixed Naming = true,
      Strong Naming = true,
      use key file = true,
      Key = C:\MyKey.snk,
      delay signing = unchecked,
      mark assemblies = true.
    8. The assembly is decorated with the Attribute [assembly: AssemblyCulture("")] in the User Control's code-behind class.
    9. The KB article http://support.microsoft.com/kb/924731 does not help.
    10. The project uses C#.
    11. The code is very simple, just a HelloWorld sample for now.
    12. If the User Control is removed from the ASPX page entirely, then the "Publish Web Site" process runs without any errors.

    Do you have any suggestions?

    Please advise.

    Thank you.

     -- Mark Kamoski

  • Re: Publish Web Site Error - file 'src' is not a valid here because it doesn't expose a type

    02-15-2007, 12:36 PM
    • Member
      395 point Member
    • bobby169
    • Member since 03-22-2004, 4:27 AM
    • India
    • Posts 81

    Try reinstalling IIS metabase using following command on command prompt

    cd C:\WINNT\Microsoft.NET\Framework\v2.0.50727\

    aspnet_regiis -i

    This might help ....

  • Re: Publish Web Site Error - file 'src' is not a valid here because it doesn't expose a type

    02-15-2007, 12:41 PM
    • Contributor
      5,028 point Contributor
    • mkamoski
    • Member since 07-04-2002, 8:05 PM
    • ZULU-0500
    • Posts 1,376
    bobby169:

    Try reinstalling IIS metabase using following command on command prompt

    cd C:\WINNT\Microsoft.NET\Framework\v2.0.50727\

    aspnet_regiis -i

    This might help ....

    bobby169 --  

    That was a good idea-- but, it did not help.

    If you have other ideas, then please post them.

    Thank you.

    -- Mark Kamoski

  • Re: Publish Web Site Error - file 'src' is not a valid here because it doesn't expose a type

    02-15-2007, 1:16 PM
    • Member
      32 point Member
    • SWarren
    • Member since 06-11-2002, 9:53 AM
    • Posts 6
    • ASPInsiders

    Mark --

    My sympathies!  This is perhaps the least helpful error I've ever encountered in .NET -- I'm sorry you are seeing it too. 

    It's my belief that this error indicates a failure of runtime compilation (without actually showing the compilation error Super Angry).  In my case it was hiding a problem with the AssemblyCulture attribute; I think it's hiding a different problem in your case. 

    I don't use file-based webs myself, so I don't have a complete picture of all the pieces that get compiled or partially compiled before and during a publish.  But in your shoes I'd try to the following to debug the issue:

    • Clear the ASP.NET compiliation cache: usually C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
    • Publish to a different location
    • Set the Publish option to delete old files from the target location upon Publish.  (I dunno if this is supported for file-based web; it is for project-based webs.)
    • Change the other Publish option, especially if you guess they will change the way the web is compiled.  In particular, try publishing without signing the assembly.
    • Try a different user control

    Hope this helps -- post back and let us know if you find the answer!

    Susan

Page 1 of 1 (4 items)