vendredi 28 novembre 2014

Recaptcha.dll not found after webpart deployment



I'm developing a webpart that contains a form for register data and send it to a list.


I know a little about Sharepoint webpart development but again, implementation of external resources in SharePoint customizable webparts (not even the development using SPListItems, SPQuery, etc) still produces me headaches...


I'm trying add recaptcha control in this webpart form, but after the deployment I check the form in runtime and I get this error:



Parser Error Message: Could not load file or assembly 'Recaptcha, Version=1.0.5.0, PublicKeyToken=9afc4d65b28c38c2' or one of its dependencies. The system cannot find the file specified.



The full error that shows me the Elements tab in Google Chromes says:



[FileNotFoundException]: Could not load file or assembly 'Recaptcha, Version=1.0.5.0, PublicKeyToken=9afc4d65b28c38c2' or one of its dependencies. The system cannot find the file specified. at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Web.Configuration.CompilationSection.LoadAssembly(String assemblyName, Boolean throwOnFail) at System.Web.UI.TemplateParser.AddAssemblyDependency(String assemblyName, Boolean addDependentAssemblies) at System.Web.UI.MainTagNameToTypeMapper.ProcessTagNamespaceRegistrationCore(TagNamespaceRegisterEntry nsRegisterEntry) at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) [HttpParseException]: Could not load file or assembly 'Recaptcha, Version=1.0.5.0, PublicKeyToken=9afc4d65b28c38c2' or one of its dependencies. The system cannot find the file specified. at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) [HttpParseException]: Could not load file or assembly 'Recaptcha, Version=1.0.5.0, PublicKeyToken=9afc4d65b28c38c2' or one of its dependencies. The system cannot find the file specified. at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at Glogic.FormLiberty.FormLiberty.FormLiberty.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



The steps I follow for add the dll in GAC and SharePoint project are:



  • Register the dll in GAC using Visual Studio Command Prompt.

  • Add the dll directly in /bin folder.

  • Add the dll in the Package folder following the steps described in this answer.

  • Check in the manifest.xml file if the dll is already registered.


In this link says that the recaptcha.dll must be added in a SafeControl tag instead in a Assembly tag:


I haven't the log files. In resumen, the main problem is:


Could not load file or assembly or one of its dependencies. The system cannot find the file specified.


I downloaded the recaptcha.dll here








0 commentaires:

Enregistrer un commentaire