Rješenje problema: “FileNotFoundException” With My igrani prijemnik.

I was working on a feature last week that would add some event receivers to a specific list instance. (I blogged nešto o tom popisu primatelja ovdje).

Korištenje naredbenog retka, Sam mogao instalirati tu značajku bez pogreške (ali vidi dolje za skrivene greške). When I tried to deploy the feature on the site, MOSS complained of a "FileNotFoundException" pogreška. This blog entry describes how I solved it.

To je pogreška koja MOSS mi je pokazao u web pregledniku:

Feature ‘b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ could not be installed because the loading of event receiver assembly "xyzzyFeatureReceiver_0" Neuspjela: System.IO.FileNotFoundException: Could not load file or assembly ‘xyzzyFeatureReceiver_0’ ili jedan od njegovih ovisnosti. Sustav ne može pronaći navedenu datoteku.
Naziv datoteke: ‘xyzzyFeatureReceiver_0’
at System.Reflection.Assembly.nLoad(AssemblyName filename, Gudački codebase, Dokazi assemblySecurity, Skupština locationHint, StackCrawlMark& stog tlo, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Dokazi assemblySecurity, StackCrawlMark& stog tlo, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(Gudački assemblyString, Dokazi assemblySecurity, StackCrawlMark& stog tlo, Boolean forIntrospection)
at System.Reflection.Assembly.Load(Gudački assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Skupština obvezujuća bilježenje isključeno.
Da biste omogućili sastavljanje prijave kvara vezanja, postavite vrijednost registra [HKLM Software Microsoft Fusion!EnableLog] (DWORD) na 1.
Primijetiti: Tu je neke performanse kazna povezana s montažnim prijave vezanje neuspjeh.
Da biste isključili tu značajku, izvadite vrijednost registra [HKLM Software Microsoft Fusion!EnableLog].

Rješavanje problema s Windows SharePoint Services.

Znam kako namjerno izazvati tu pogrešku: don’t install the assembly in the GAC. Ali, it was in the GAC. I normally install assemblies into the GAC by dragging them into the c:\windows\assembly folder using windows explorer. I’ve never felt 100% ugodno, jer sam uvijek mislio da je postojala gacutil s razlogom … so I tried that. It made no difference.

Tražila sam internets i pronašao ovaj post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

Plakat se dogodilo da se koristi isti korijen malo koda (iznutra WSS knjige iz ovog popisa) so that was a hopeful sign. Međutim, Prijedlog o ukrašavanju skupštine s [montaža: ] directive didn’t make sense to me. I tried it anyway and I was right. It made no difference.

Then I noticed that my class definition was not public. I made it public and that made no difference.

Sljedeći, I went to the trouble of enabling the "assembly bind failure log" (nakon korisne i točne upute koje) and this is where things started to get interesting. That log shows me that the runtime is searching everywhere on that server for my assembly. It even appears to be searching for it in my medicine cabinet. Ali … neće ga potražiti u GAC.

I put on my winter jacket and go searching the Internets again and find that someone has had this problem too. The lengthy discussion in that posting peters off into nothing and I can’t find a solution.

I move my assembly into one of the places the log claims it’s searching and I make a little more progress. I’m rewarded with a new error in the browser when I try to activate the feature:

Failed to create feature receiver object from assembly "xyzzyFeatureReceiver_0", type "Conchango.xyzzyFeatureReceiver" za lice b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: Vrijednost ne može biti nula.
Naziv parametra: tip
at System.Activator.CreateInstance(Tip putovanja, Boolean nisu za javnost)
at System.Activator.CreateInstance(Tip putovanja)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Rješavanje problema s Windows SharePoint Services.

Vrijeme je za jedan posljednji izlet na internets!

Ovaj put saznam, predvidivo dovoljno, that MOSS issues this error because the assembly is not in GAC.

Želim da se nešto pozitivno iz ovog i pokušajte osjetiti malo ponosan što sam stvorio Bjegunac od MSIL skupštinama, but it’s not working. I’m just plain annoyed. I find myself muttering "chicken or the egg" ispod glasa.

I finally decide to punt. I create an entirely new project and copy/paste the code from the incredible-cloaked-from-the-GAC-assembly non-working project over to this new project. (I look for a build flag called something like "hide from assembly binding if installed in the GAC" ali ne mogu naći jedan).

Ja instalirajte značajku i aktivirali i … to radi! Tako, nakon svega što, I had to basically ‘reboot’ my project. To je još jedan razlog zašto mrzim računala.

I did learn something useful from this. I had been installing features using the stsadm command line all day long and been using the "-force" option out of habit. Iz nekog razloga, I did not use the -force option when I installed the new project. Ovaj puta, Ja sam zapravo, truly forget to copy this new project’s assembly into the GAC. Kao rezultat toga, I received that "FielNotFoundException" pogreška. Ovaj puta, Dobio sam to od stsadm, not when I tried to activate the feature via the web browser. Tako, -force actually plays two roles. It allows you to re-install an existing feature. It also allows you to install a buggy feature that cannot work at runtime by suppressing the error. It probably says as much in the help somewhere but I never noticed it.

</kraj>

Technorati Tags: ,

3 misli o „Rješenje problema: “FileNotFoundException” With My igrani prijemnik.

  1. Francisco

    Također, Imala sam 2 sati histerična nintendoSIXTYFOURRRR-u-bad-way trenutaka kad sam preimenovana u prostoru imena na Feature prijemnicima, pomoći pratiti gdje je vaša ili bilo tko drugi je započeo.

  2. Francisco

    Korijen problema leži na razmještene WSP u SharePoint baze podataka. Pročitala sam tvoj post i dok ga doista riješiti problem imamo veliku rješenje s nekoliko projekata, a više desetaka datoteka tako kreće sve što nije bila opcija.

    Bez obzira koliko ste ažurirali GAC ili svoj sklop, ono što je dajući vam problema je Skupština u tekućem WSP instaliran na SharePoint.

    Možete jednostavno primijetio da je samo pokušavao uvući rješenje (što je gdje dogodi pogreška). Everything happening on "Retracting Time" should be considered "deployed wsp"-only not the project itself.

    Moj je zaobilazno rješenje:

    – Središnji admin: Odustani rješenje
    – stsadm: deletesolution
    – Visual Studio => Projekt => Paket
    – stsadm: addsolution-file Projekt bin Debug Project.wsp
    – stsadm: deploysolution-Naziv project.wsp-neposredna-allowgacdeployment-force
    – Visual Studio => Razviti

    Ja se također briše koš za smeće i ispravljanje mape iz projekta prije pokretanja ponovno rasporediti, možda neće imati nikakvog utjecaja, ali vrijedi komentirajući.

    Ovo radi za oboje

    "Feature … nije mogao biti instaliran jer učitavanje događaja prijemnik skupštine"
    i
    "Failed to create feature receiver object from assembly"

    Hvala!
    Francisco

  3. Tom Clarkson

    Just spent a couple of hours trying to fix this same issue and found a better solution than simply recreating the project.

    It turned out that for some reason Visual Studio had set the build target to x86 instead of x64 or MSIL – the assembly was in the GAC, just not the same GAC that 64 bit SharePoint was looking in.

Ostavite odgovor na Francisco Odustani odgovor

Vaša email adresa neće biti objavljena. obavezna polja su označena *