გამოსავალი პრობლემური: “FileNotFoundException” ერთად ჩემი მხატვრული მიმღები.

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" error. 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 ფაილის სახელი, სიმებიანი codeBase, მტკიცებულება assemblySecurity, ასამბლეის locationHint, StackCrawlMark& დასტის ნიადაგის, ლოგიკური throwOnFileNotFound, ლოგიკური forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, მტკიცებულება 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: ასამბლეის შესასრულებლად სავალდებულო ჭრა გამორთულია.
იმისათვის, რომ ჩავრთოთ ასამბლეის სავალდებულოა მარცხი ხე, მითითებული რეესტრის ღირებულება [HKLM Software Microsoft Fusion!EnableLog] (DWORD) to 1.
შენიშვნა: არსებობს გარკვეული წარმოდგენა საჯარიმო ასოცირდება ასამბლეის სავალდებულოა მარცხი ხე.
გახდეს ამ ფუნქციის off, ამოიღონ რეესტრის ღირებულება [HKLM Software Microsoft Fusion!EnableLog].

პრობლემების საკითხებზე Windows SharePoint Services.

მე ვიცი, როგორ განზრახ იწვევს, რომ შეცდომა: 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: ღირებულება არ შეიძლება იყოს null.
პარამეტრის სახელი: ტიპის
at System.Activator.CreateInstance(გაცნობის ტიპის, ლოგიკური nonPublic)
at System.Activator.CreateInstance(გაცნობის ტიპის)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

პრობლემების საკითხებზე Windows SharePoint Services.

ახლა ერთი ბოლო მოგზაურობა Internets!

ამჯერად მე გასარკვევად, როგორც მოსალოდნელი საკმარისი, that MOSS issues this error because the assembly is not in GAC.

მე მინდა რაღაც პოზიტიური აქედან და ცდილობენ გრძნობენ ცოტა ვამაყობთ, რომ მე შექმნა გაქცეული of 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" error. ამჯერად, მე მივიღე ეს 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 "გამოსავალი პრობლემური: “FileNotFoundException” ერთად ჩემი მხატვრული მიმღები.

  1. Francisco

    ასევე, მქონდა 2 საათი ისტერიული nintendoSIXTYFOURRRR-in-a-ცუდი გზა მომენტები, როცა დაარქვეს სახელთა სივრცე მხატვრული მიმღები, რათა დაეხმაროს სიმღერა, სადაც თქვენი ან ვინმე სხვისი დაიწყო.

  2. Francisco

    ძირეული პრობლემის ეკისრება განლაგებული wsp in SharePoint მონაცემთა ბაზა. წავიკითხე თქვენი პოსტი და სანამ ეს იმას ნამდვილად პრობლემაზე ჩვენ გვაქვს დიდი გამოსავალი ერთად რამდენიმე პროექტი და ათობით ფაილი ისე მოძრავი ყველაფერი არ იყო ვარიანტი.

    არ აქვს მნიშვნელობა, რამდენად განახლება GAC ან თქვენი ასამბლეის, რა არის გაძლევთ უბედურება არის შეკრების მიმდინარე WSP დამონტაჟებული SharePoint.

    თქვენ მარტივად შენიშნა, რომ ცდილობს მხოლოდ retract გადაწყვეტა (რაც არის, სადაც შეცდომა ხდება). Everything happening on "Retracting Time" should be considered "deployed wsp"-only not the project itself.

    ჩემი Workaround იყო:

    – ცენტრალური admin: უარი გადაწყვეტა
    – stsadm: deletesolution
    – ვიზუალური სტუდია => პროექტის => პაკეტი
    – stsadm: addsolution-ფაილი Project bin გამართვის Project.wsp
    – stsadm: deploysolution-name project.wsp-დაუყოვნებლივ-allowgacdeployment-force
    – ვიზუალური სტუდია => განათავსოს

    მე ასევე ამოღებულია ბინ და გამართვის დასტების პროექტის გაშვებამდე განათავსოს ერთხელ, შეიძლება არ აქვს არანაირი ეფექტი მაგრამ ღირს კომენტირებისას.

    ეს მუშაობს როგორც

    "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 პასუხის გაუქმება

თქვენი ელ-ფოსტა არ გამოქვეყნდება. აუცილებელი ველები მონიშნულია *