Failed to load receiver assembly

SP2013

Hello everyone,

Today I will talk about a problem that appeared recently on one of my development environments.

Wishing test my package deployment phase, I found myself in front of the error

Error occurred in deployment step ‘Add Solution’: Failed to load receiver assembly “Assembly Signature” for feature ” MyProject _Provisioning_Web” (ID: GUID).: System.IO.FileNotFoundException: Could not load file or assembly Assembly Signature ‘ or one of its dependencies. The system cannot find the file specified.

File name: Assembly Signature

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)

   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

   at System.Reflection.Assembly.Load(String assemblyString)

   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

 

(Of course the deployment through Visual Studio was done correctly … long live the “-force”)

At first glance, it is not able to find some files during deployment. After losing my hair myself for several hours I found this topic which provided me the solution => re-sign the package.

http://stackoverflow.com/questions/10195931/why-is-my-projects-assembly-missing-from-the-package-when-i-debug

I confess to being skeptical about the why, perhaps due to a problematic Visual Studio build process. Having the problem on a new project created on this environment I think the installation of the development server was not properly performed.

Hope this helps.

Christopher.

Hide SharePoint Ribbon for anonymous user

SP2013


Hello everyone,

Today I will talk about a little trick for anonymous access on SharePoint 2013.

Often the customer tells you “I want a SharePoint but I do not want visitors to see the ribbon, there is no use for them!

Although I’m not entirely agree, sometimes I hide the ribbon for anonymous.

For this, a delegate control containing security trimmed control targeting anonymous 3 lines of JavaScript and is ready to deploy.

But then, if it looks good at first, there is a problem that appears when the anonymous visitor open a list item (eg an advertisement).

Indeed, by default when viewing an item, the ribbon load on the “View Item” tab which displays the ribbon large, which means that even hiding the ribbon via JavaScript, size dynamically taken the ribbon is reserved and we are stuck with a white stripe above our page!

To fix this little display problem, specify the ribbon to be minimized, which can be done in the following way.

« _ribbon.buildMinimized = true; »

The full code of the control is:


<SharePoint:SPSecurityTrimmedControl ID="HideSectionForAnonymous" 
runat="server" AuthenticationRestrictions="AnonymousUsersOnly">

<script type="text/javascript">

document.getElementById("globalNavBox").style.display = "none";

document.getElementById("suiteBar").style.display = "none";

 

function HideRibbon () {

if (_ribbon != null) {

_ribbon.buildMinimized = true;

}

}

_spBodyOnLoadFunctionNames.push("HideRibbon");

</script>

</SharePoint:SPSecurityTrimmedControl>

For information I add this user control via a delegate control as follows


<Control Id="PromotedActions" Sequence="1"
ControlSrc="~/_ControlTemplates/15/MyProject/HideTopRibbon.ascx" />

 

Hope this helps.

Christopher.