tags:

views:

47

answers:

1

I've created a user control and added that user control to my webpart. But when i try to add the webpart in a page. i am facing the above stated problem.I ensured that dll was present in GAC. I've created a user control and added that user control to my class library. I've compiled and signed the dll and have added it to the gac. But when i try to add the webpart in a page i'm getting the below mentioned error.And made necessary changes in web.config file. I've made sure that dll is there in the gac. But i'm still getting the same error.

" An error occurred during the processing of . Could not load the assembly 'Generate ,       Version=1.0.0.0, Culture=neutral, PublicKeyToken=e5b42758c1bfd2df'. Make sure that it is compiled   before accessing the page. "

please help me.

+1  A: 
  • Make sure the user control inherits from the solution assembly in the Control tag
  • Load the control in the CreateChildControls method of the Web Part
  • Put this user control under the CONTROLTEMPLATES folder

Are you deploying is as a Feature?

To debug locally, check the following in your config file:

* customErrors=off
* Enable Stack Traces by adding CallStack=”true” to the SafeMode tag
* Set the compilation debug attribute to "true"
IrishChieftain
Hi, i had cpoied my user control into control templates,loaded the user control in CreateChildControls method of the Web part,my dll is present in the GAC.i made my control as safe in web.config file.
suganya
Can you check the Event Viewer Windows application log file and see if there's any info on the error in there?
IrishChieftain
Also, can you post the the <SafeControls> snippet form your config file?
IrishChieftain
This is the code<SafeControl Assembly="BingTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5485e5bd95d6c3e4" Namespace="BingTest" TypeName="*" Safe="True" />
suganya
Check this article from Andrew Connell, one user in the comments section was getting the same error as you:http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspxI've posted a two-parter on Web Parts here:http://www.codersbarn.com/?tag=/webpart
IrishChieftain
hi lrishChieftain, Thanks a lot for your reply.
suganya