Լուծում Problem: “FileNotFoundException” Իմ Feature ստացողի.

I was working on a feature last week that would add some event receivers to a specific list instance. (Ես Blogged մի քիչ այդ ցուցակից ստացողի այստեղ).

Օգտագործելով հրամանի տող, Ես կարող եմ տեղադրել հնարավորությունը առանց սխալի (Բայց տես ստորեւ համար թաքնված սխալի). When I tried to deploy the feature on the site, MOSS complained of a "FileNotFoundException" սխալ. This blog entry describes how I solved it.

Սա սխալ է, որ MOSS ցույց ինձ վեբ բրաուզերի:

Feature ‘b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ could not be installed because the loading of event receiver assembly "xyzzyFeatureReceiver_0" տապալվեց: System.IO.FileNotFoundException: Could not load file or assembly ‘xyzzyFeatureReceiver_0’ կամ դրա կախվածությունը. Համակարգը չի կարող գտնել ֆայլը նշված.
Ֆայլի անունը: ‘xyzzyFeatureReceiver_0’
at System.Reflection.Assembly.nLoad(AssemblyName Ֆայլի, String codebase, Ապացույցներ assemblySecurity, Վեհաժողովը locationHint, StackCrawlMark& դեղ հողը, Բուլյան throwOnFileNotFound, Բուլյան forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Ապացույցներ assemblySecurity, StackCrawlMark& դեղ հողը, Բուլյան forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Ապացույցներ assemblySecurity, StackCrawlMark& դեղ հողը, Բուլյան forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Վեհաժողովը պարտադիր անտառահատումները անջատված.
Որպեսզի ժողովի կապում անհաջողության logging, սահմանել ռեգիստրային արժեքը [HKLM Software Microsoft Fusion!EnableLog] (DWORD) դեպի 1.
Նշում: Կա մի կատարում տույժը կապված հավաքների կապում ձախողումը հատումների.
Դիմել այս հնարավորությունը դուրս, հանել ռեգիստրային արժեքը [HKLM Software Microsoft Fusion!EnableLog].

Troubleshoot խնդիրները Windows SharePoint ծառայություններ.

Ես գիտեմ, թե ինչպես պետք է միտումնավոր պատճառել այդ սխալը: don’t install the assembly in the GAC. Սակայն, 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% հարմարավետ անում է, որովհետեւ ես միշտ էլ մտածեցի, որ gacutil գոյություն դա պատճառ … so I tried that. It made no difference.

Ես փնտրում է Internets եւ գտել այս գրառումը: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

Պաստառի տեղի է օգտագործելով նույն արմատային քիչ կոդը (ներսից WSS գրքի այս ցուցակում) so that was a hopeful sign. Սակայն, առաջարկով զարդարում ժողովին հետ [ժողով: ] 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.

Հաջորդ, I went to the trouble of enabling the "assembly bind failure log" (հետո օգտակար եւ ճշգրիտ ցուցումների նախատեսված) 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. Սակայն … այն չի փնտրում դրա համար, որ 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" եւ խաղարկային b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: Value կարող լինել առ.
Պարամետր անունը: տիպ
at System.Activator.CreateInstance(Type տեսակը, Բուլյան nonPublic)
at System.Activator.CreateInstance(Type տեսակը)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Troubleshoot խնդիրները Windows SharePoint ծառայություններ.

Ժամանակը մի վերջին մեկնելու է Internets!

Այս անգամ ես պարզել,, predictably բավարար, that MOSS issues this error because the assembly is not in GAC.

Ես ուզում եմ ստանալ մի բան, դրական դուրս եւ փորձել զգալ մի քիչ հպարտ եմ, որ ես եմ ստեղծել այն Ընդհատակում րդ MSIL հավաքների, but it’s not working. I’m just plain annoyed. I find myself muttering "chicken or the egg" տակ իմ շունչը.

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" բայց չի կարող գտնել մեկին).

Ես տեղադրել առանձնահատկությունը եւ ակտիվացրեք եւ … այն աշխատում! Այնքան, հետո այդ, I had to basically ‘reboot’ my project. Սա եւս մեկ պատճառ, թե ինչու եմ ատում համակարգիչներ.

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. Ինչ - ինչ պատճառներով, I did not use the -force option when I installed the new project. Այս անգամ, Ես իրականում, truly forget to copy this new project’s assembly into the GAC. Արդյունքում, I received that "FielNotFoundException" սխալ. Այս անգամ, Ես այն stsadm, not when I tried to activate the feature via the web browser. Այնքան, -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.

</վերջ>

3 thoughts on "Լուծում Problem: “FileNotFoundException” Իմ Feature ստացողի.

  1. Francisco

    Նույնպես, Ես իմ 2 ժամ hysteric nintendoSIXTYFOURRRR-in-a-bad-կերպ պահերին, երբ ես վերանվանել Անվանատարածք է Feature ստացողի, օգնել Հետեւել որտեղ ձերն է կամ anyone else է սկսվել.

  2. Francisco

    Հիմքում ընկած խնդրի մեջ է տեղակայված wsp է SharePoint տվյալների բազայում. Ես կարդացի ձեր գրառումը, եւ երբ այն իսկապես ամրագրել խնդիրը, որ մենք ունենք մի հսկայական լուծում է մի քանի նախագծերի եւ տասնյակ ֆայլերի այնքան շարժվող ամեն ինչ չէր տարբերակ.

    Անկախ նրանից, թե որքան եք նորացնել Ձեր GAC կամ ժողովում, ինչ է տալիս ձեզ դժվարության է ժողովը ներկա WSP տեղադրվել SharePoint.

    Դուք կարող եք հեշտությամբ նկատել, որ փորձում է ընդամենը հրաժարվել լուծմանը (որը, որտեղ տեղի է ունենում սխալ). Everything happening on "Retracting Time" should be considered "deployed wsp"-only not the project itself.

    Իմ workaround էր:

    – Կենտրոնական admin: Չեղարկել լուծում
    – stsadm: deletesolution
    – Visual Studio => Ծրագրի => Փաթեթ
    – stsadm: addsolution-file Project բեն Debug Project.wsp
    – stsadm: deploysolution-name project.wsp-անմիջական-allowgacdeployment-Force
    – Visual Studio => Տեղակայել

    Ես նաեւ ջնջված բեն եւ Debug թղթապանակներ են ծրագրի համար վազում տեղակայել է, կարող որեւէ ազդեցություն, բայց արժեքը մեկնաբանելով.

    Այս աշխատանքները, այնպես էլ

    "Feature … չի կարող տեղադրվել, քանի որ բեռնելը միջոցառման ընդունիչ հավաքներ"
    իսկ
    "Failed to create feature receiver object from assembly"

    Շնորհակալություն!
    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.

Թողնել Պատասխանել Francisco Ավելացնել կարծիք Չեղարկել պատասխանել

Ձեր էլ. Փոստի հասցեն չի հրապարակվելու. Պահանջվող դաշտերը նշված են աստղանիշով *