When doing ASP.Net development hosted in SharePoint, I occasionally found the following error when opening certain page, and the page that showed this error changes, one day it could be page A, another day it could be page B and this appears at random times. By turning off custom errors and showing stack trace I got the following error:
Server Error in ‘/’ Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type ‘projectname.assemblyname’.
Source Error:
|
Line 1: <%@ Page Language=”C#” MasterPageFile=”~masterurl/default.master” Line 2: CodeBehind=”MyPage.aspx.cs” Inherits=”projectname.assemblyname.MyPage” Line 3: meta:progid=”SharePoint.WebPartPage.Document” %> |
Source File: /subsite/MyPage.aspx Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
I didn’t have this error in development server but constantly having this error at random times in client’s server. Doing IIS Reset or Recycle the Application Pool seems to get rid of the issue only for temporary. My guess is the assembly is not being “linked” properly after some process running in the server. I’ve placed the assembly in the bin folder of the web application but the issue always appear again and again at random time. I’ve added the assemby in web.config as well in the safe control section.
When googling about the issue I found a post that’s indirectly linked to this issue. I’m not sure if this has to do with using AAM (Alternate Access Mapping) or not but somehow the assembly at certain time “looses” the “mapping” to the location of the assembly.
So, from the post, I forgot the link to it, but it’s an old post about ASP, will post it here once I found it (it was burried deep inside google search result), I tried adding below section into web.config file of the SharePoint web application right inside the <assemblies> tag:
<compilation batch=”false” debug=”false”>
<assemblies>
<add assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” />
<add assembly=”projectname.assemblyname, Version=1.0.0.0, Culture=neutral, PublicKeyToken=uniqueassemblytoken” />
</assemblies>
This has resolved the issue for me.
If there’s any one know why is this happening at random time and the cause please let me know. I’ll updated the post.
Wai, He post the sacred frikin’ problem
* fricking
doh typo
Sacred problem?? What’s so sacred about ASP.Net besides it is hosted in SharePoint *doh*
Hmm bener2 seorang ****
hail to charlesss wakakakka…
*edited…I’m not what you said I am, too overrated lah itu* :LOL: