સમસ્યા માટે ઉકેલ: “FileNotFoundException” મારી લક્ષણ રીસીવર સાથે.

I was working on a feature last week that would add some event receivers to a specific list instance. (હું અહીં યાદી રીસીવર વિશે થોડી બ્લોગ).

આદેશ વાક્ય મદદથી, હું કોઈ ભૂલ સાથે લક્ષણ સ્થાપિત કરી શકે છે (પરંતુ છુપાયેલા ભૂલ માટે નીચે જુઓ). 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, શબ્દમાળા કોડબેઝમાં, પુરાવા assemblySecurity, વિધાનસભા locationHint, StackCrawlMark& માટી સ્ટેક, બુલિયન throwOnFileNotFound, બુલિયન forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyRef AssemblyName, પુરાવા assemblySecurity, StackCrawlMark& માટી સ્ટેક, બુલિયન forIntrospection)
at System.Reflection.Assembly.InternalLoad(શબ્દમાળા assemblyString, પુરાવા assemblySecurity, StackCrawlMark& માટી સ્ટેક, બુલિયન forIntrospection)
at System.Reflection.Assembly.Load(શબ્દમાળા assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: વિધાનસભા બંધાઈ લોગીંગ બંધ છે.
વિધાનસભા bind નિષ્ફળતા લોગીંગ સક્રિય કરવા માટે, આ રજિસ્ટ્રી કિંમત સુયોજિત [HKLM સોફ્ટવેર માઈક્રોસોફ્ટ ફ્યુઝન!EnableLog] (DWORD) માટે 1.
નોંધ: વિધાનસભા bind નિષ્ફળતા લોગીંગ સાથે સંકળાયેલ અમુક કામગીરી દંડ છે.
આ સુવિધાને બંધ કરવા માટે, આ રજિસ્ટ્રી કિંમત દૂર [HKLM સોફ્ટવેર માઈક્રોસોફ્ટ ફ્યુઝન!EnableLog].

વિન્ડોઝ શેરપોઈન્ટ સર્વિસ સાથે સમસ્યાનું નિવારણ.

હું ઇરાદાપૂર્વક કે ભૂલ કારણ ખબર કેવી રીતે: 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. પરંતુ … તે જીએસી તે શોધવા નહીં.

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: કિંમત નલ કરી શકાતી નથી.
પરિમાણ નામ: પ્રકાર
at System.Activator.CreateInstance(પ્રકાર પ્રકાર, NonPublic બુલિયન)
at System.Activator.CreateInstance(પ્રકાર પ્રકાર)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

વિન્ડોઝ શેરપોઈન્ટ સર્વિસ સાથે સમસ્યાનું નિવારણ.

જો 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.

</અંત>

Technorati ટૅગ્સ: ,

3 પર "વિચારોસમસ્યા માટે ઉકેલ: “FileNotFoundException” મારી લક્ષણ રીસીવર સાથે.

  1. ફ્રાન્સિસ્કો

    પણ, હું હતી મારી 2 હું લક્ષણ રીસીવર પર નામસ્થળ નામ આપવામાં આવ્યું છે જ્યારે hysteric nintendoSIXTYFOURRRR ઈન એક ખરાબ રીતે ક્ષણોમાંની કલાક, ટ્રેક કરવા માટે મદદ માટે તમારામાં અથવા અન્ય કોઈને શરૂ કર્યું છે જ્યાં.

  2. ફ્રાન્સિસ્કો

    આ સમસ્યા રુટ શેરપોઈન્ટ ડેટાબેઝમાં જમાવાયેલ wsp પર આવેલું. હું તમારી પોસ્ટ વાંચી અને તે ખરેખર આ સમસ્યા ઠીક નથી, જ્યારે અમે આમ ખસેડવાની બધું એક વિકલ્પ ન હતો ફાઈલો વિવિધ પ્રોજેક્ટ અને ડઝનેક સાથે એક વિશાળ ઉકેલ છે.

    તમે તમારા જીએસી અથવા તમારા વિધાનસભા અપડેટ કેટલી કોઈ બાબત, શું તમે મુશ્કેલી આપે છે શેરપોઈન્ટ પર સ્થાપિત વર્તમાન WSP માં વિધાનસભા છે.

    તમે સરળતાથી માત્ર ઉકેલ પાછો કરવાનો પ્રયાસ દ્વારા જણાયું કે કરી શકો છો (ભૂલ થાય છે જ્યાં છે). Everything happening on "Retracting Time" should be considered "deployed wsp"-only not the project itself.

    મારો ઉકેલ હતી:

    – સેન્ટ્રલ એડમિન: ઉકેલ રદ કરો
    – stsadm: deletesolution
    – વિઝ્યુઅલ સ્ટુડિયો => પ્રોજેક્ટ => પૅકેજ
    – stsadm: addsolution-ફાઈલ પ્રોજેક્ટ બિન ડીબગ Project.wsp
    – stsadm: deploysolution-નામ project.wsp-તાત્કાલિક-allowgacdeployment-બળ
    – વિઝ્યુઅલ સ્ટુડિયો => ફેલાવવું

    હું પણ ફરી જમાવો ચલાવવા પહેલાં પ્રોજેક્ટ ના bin અને ડિબગ ફોલ્ડર્સ કાઢી નાખવામાં, કોઇ અસર પરંતુ વર્થ ટિપ્પણી ન શકે.

    બંને માટે આ કામો

    "Feature … સ્થાપિત કરી શકાઈ નથી કારણ કે ઘટના રીસીવર વિધાનસભા લાવવાનું"
    અને
    "Failed to create feature receiver object from assembly"

    આભારદર્શક શબ્દો!
    ફ્રાન્સિસ્કો

  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.

એક જવાબ છોડો ફ્રાન્સિસ્કો જવાબ રદ કરો

તમારું ઇમેઇલ સરનામું પ્રકાશિત કરવામાં આવશે નહીં. જરૂરી ક્ષેત્રો ચિહ્નિત થયેલ છે *