English 中文(简体)
A. 失败
原标题:Failure Loading Of Event Receiver Assembly
  • 时间:2011-04-27 07:10:02
  •  标签:
  • sharepoint

我的特稿有以下几条。

<Feature Id="0c272f81-49c0-440a-a544-677d51a8ffe4"
    ReceiverAssembly="FeaturedMasterPage, Version 1.0.0.0, Culture=Neutral, PublicKeyToken=9f4da00116c38ec5"
    ReceiverClass="FeaturedMasterPage.FeatureEventReciever"
    Title="Branding202" 
    Scope="Web" 
    Version="1.0.0.0" 
    Hidden="FALSE" 
    DefaultResourceFile="core" 
    xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="Branding202Module.xml" />
    <ElementFile Location="Branding202Branding202.Master" />
  </ElementManifests>
</Feature>

我的特写明:

using System;
using System.Collections.Generic;
using Microsoft.SharePoint;
using System.Text;
using System.Diagnostics;

namespace FeaturedMasterPage
{
    class FeatureEventReciever:SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            try
            {
                //My Code
            }
            catch (Exception)
            {
                throw;
            }
        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            try
            {
                //My Code
            }
            catch (Exception)
            {

                throw;
            }
        }

        public override void FeatureInstalled(SPFeatureReceiverProperties properties) { }

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties) { }
    }
}

When i try to deploy the solution...it gives me the following error:-

Error 1 Feature 0c272f81-49c0-440a-a544-677d51a8ffe4 could not be installed because the loading of event receiver assembly "FeaturedMasterPage, Version 1.0.0.0, Culture=Neutral, PublicKeyToken=9f4da00116c38ec5" failed: System.IO.FileLoadException: Could not load file or assembly FeaturedMasterPage, Version 1.0.0.0, Culture=Neutral, PublicKeyToken=9f4da00116c38ec5 or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) File name: FeaturedMasterPage, Version 1.0.0.0, Culture=Neutral, PublicKeyToken=9f4da00116c38ec5 at System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

    0   0   

我已经花了整天的时间来解决这个问题。 我已经用gacutil装置了这辆车。

希望得到任何帮助。

最佳回答

Maybe it s just something gone wrong in StackOverflow automatic formatting, but I don t see the "equals" sign in your assembly s full name (at the ReceiverAssembly="...." part).

FeaturedMasterPage, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=9f4da00116c38ec5

我看到的是:

FeaturedMasterPage, Version 1.0.0.0, Culture=Neutral, PublicKeyToken=9f4da00116c38ec5
问题回答

不幸的是,我怀疑这个问题与你的法典有关,而是根据你的法典,只有你才能确定。

  1. Verify your assembly name.
  2. Verify your full class name.
  3. Verify your assembly is getting included in the solution file.

If you get past number three then it s a SharePoint issue but judging by the errors, I can almost guarantee you that it s simply a bad reference.

您能否尝试通过PowerShell手工装货?

Try to rename the Assembly by right Pointing the Project name >> Property >> from the Application tabname both of the “Assembly name/strong> and “ to be the same name. 我面临这个问题,这是解决该问题的办法。 希望能帮助你们。





相关问题
SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

UI automated testing within SharePoint

I m looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and documents thought the web interface. It needs to be extensible enough to handle any custom ...

Enable authorization on sitemap provider

I want to enable Authorization on the Site map provider. We have enabled anonymous access to the site and we want the Site map provider to be visible only to authorized users. I tried ...

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...