我的特稿有以下几条。
<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装置了这辆车。
希望得到任何帮助。