none
Customized .aspx and bin: Parser Error Message: Could not load type 'xxx.yyy.zzz'.

    Question

  • Hello,

    We deploy some custom .aspx and .ascx on SharePoint site, which reference their code-behide classes in the private assembly. Basically, the functionalities in these pages work well.
    But, these .aspx or .ascx always intermittently reports the parser error: Could not load type 'xxx.yyy.zzz'. The 'xxx.yyy.zzz' is usually referenced in the Page directive or the Control directive. 
    Then, if I recyle the application pool in IIS, the error will go away.
    Anybody knows what may cause this kind of error? Thanks.


    Xiaofeng Wang | http://www.leoworks.net | Beijing P.R.C
    Wednesday, September 02, 2009 7:58 AM

Answers

  • Finally, we figure this out. It seems there is something wrong with the permission of the bin folder.

    If we assign Everyone or Authenticated Users with Full Control to the bin folder, the error right goes away. So it must be related with permission.

    To get the best practice, I remove the inherited WSS_ADMIN_WPG and WSS_WPG groups. I manually reassign WSS_ADMIN_WPG with Full Control and reassign WSS_WPG with Read&Execute, List Folder Contents, Read. It works well.

    Nobody knows why. It's very unbelievable. But it works now.


    Hope Helpful | Xiaofeng Wang | http://www.leoworks.net
    • Marked as answer by Xiaofeng Wang Tuesday, March 16, 2010 3:25 PM
    Tuesday, March 16, 2010 3:25 PM

All replies

  • Hi, Xiaofeng

         

         It seems that you have got some problem with class load error, and the error “Could not load type” is always caused by class reference.

     

         Would you please check the following:

     

    ·         Re-Check if your class in your code-behide file is defined as public, missing public always cause this error.

     

    ·         Re-Check if there is a mismatch between your class name and the reference tag Inherits in your .aspx and .ascx.

     

         Hope this can be helpful and let me know if this is your problem.

     

         Best Regards,

    -Aaron

    Thursday, September 03, 2009 12:46 AM
  • Hello Aaron

    Thanks for you suggestion.

    As said, however,  everything about asp.net essential settings, code-behide, inherits, public access modifier, is fine because these .aspx or ascx can work well normally at the begin.

    but a few hours later, when lots of request are made, it reports the "Could not load type" error. Of course, the inherits attribute is right, the public access modifier is right, the corresponding assemble is right here, in the private bin directory.

    At this time I restart IIS or even just recyle the application pool, the error disappears and these pages work again.

    Then, when some time pass, the error reoccurs. I have no choice but to recyle the app pool.

    Thanks
    Xiaofeng Wang | http://www.leoworks.net | Beijing P.R.C
    Thursday, September 03, 2009 7:49 AM
  • Finally, we figure this out. It seems there is something wrong with the permission of the bin folder.

    If we assign Everyone or Authenticated Users with Full Control to the bin folder, the error right goes away. So it must be related with permission.

    To get the best practice, I remove the inherited WSS_ADMIN_WPG and WSS_WPG groups. I manually reassign WSS_ADMIN_WPG with Full Control and reassign WSS_WPG with Read&Execute, List Folder Contents, Read. It works well.

    Nobody knows why. It's very unbelievable. But it works now.


    Hope Helpful | Xiaofeng Wang | http://www.leoworks.net
    • Marked as answer by Xiaofeng Wang Tuesday, March 16, 2010 3:25 PM
    Tuesday, March 16, 2010 3:25 PM