We have a Sharepoint 2010 solution that we are trying to the deploy to the production environment.
We have developed this solution using Visual Studio 2010 and we have created several projects which result in a number of dlls.
We are getting the following error when accessing one of the web parts.
An error occurred during the compilation of the requested file, or one
of its dependencies. The type ‘xxxx’ is defined in an assembly that is
not referenced. You must add a reference to assembly ‘xxx,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxx’.
For installing the dlls – I have dragged and dropped them into the GAC.
Is this a good approach? Could it be the cause of the problem? perhaps there is a better way of installing into the GAC? Or perhaps they need to be installed in a particular order?? The one without dependencies first?
This is the full error from the log file:
System.Web.HttpCompileException: c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\6f2f2743\7b5d4663\App_Web_rxpractioncommonwpusercontrol.ascx.12f7e65c.q7c1p6i0.0.cs(134): error CS0012: The type ‘xxxx’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘xxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fe560f99f37381ef’. at System.Web.Compilation.AssemblyBuilder.Compile() 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 allowBuildI… a47a805d-765d-429e-b080-fe031b3e4fac
Thanks,
Joseph
Since you mention that you already tried deploying the assemblies from WSP, I thought I would list another possibility as a new answer. You are going to need to be specific about which assembly is missing first of all, and then validate that this assembly is present in the GAC of all your front ends. You need to rule out any possibility that the reference assembly actually is missing. Use the fusion log viewer as was mentioned in another answer.
Next, how was your web part developed and are you sure its the web part throwing that error? Specifically, are you using any .ascx markup in your web part to reference controls out of this ‘missing’ assembly? If so, you may need to be sure to add a
<%@ Assembly Name="" %>directive to your markup so that the asp.net compiler knows to reference it during compilation. You may potentially need to add SafeControl entries also.