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: ,

Nedjelja Zabavno: Vrh 10 Načini smetati tvoja žena

  1. Kupi brokulu kad bi znao da je već više nego dovoljno u hladnjaku.
  2. Go for a run. Cool off. Take off clean pillow case and replace with T-shirt. Cover with clean pillow case.
  3. Pri vožnji, pitati ako smo trebali ići na krivi put prema dolje jednosmjernoj ulici.
  4. Za 15 godina, svake nedjelje da žena sugerira ide u muzej, express čudi da muzeji su otvoreni u nedjelju.
  5. Za 15 godina, occasionally suggest going to the local book store on Sunday. Express surprise that they are not open on Sunday’s (puno hvala Blue Zakoni!).
  6. Koristiti 20 Točke koje treba uraditi 3 point turn.
  7. Na hladnom i ranu jesen poslijepodne, walk into the room and turn on the A/C. Complain that it’s cold. When wife says, "then why did you turn that on, glup" i dobiva se da ga isključite, grab the warm spot she had on the couch. Bonus points if she does not realize you did it until much later.
  8. Otvorite konzervu tune ukusna bijele manje tune i jesti ravno iz limenke, u krevetu, noću.
  9. Idi u kuhinju dok je žena jede večeru, otvoriti ladicu pribor za jelo i posuđe gurati okolo dok supruga vrišti, "what are you looking for!"
  10. Po primitku novih poslovnih kartica, potajno staviti ih po cijeloj kući: Ispod kreveta, u jastučnice, unutar šalica za kavu, u torbici, u džepove kaputa, auto rukavica odjeljaka, ostava — anywhere you can think of.
  11. Napišite blog unose podatke o svom suprugu.
  12. Probuditi se.
  13. Prilikom šetnje ulicama New Yorka, be on the alert for "crusty" objects on the ground. Imajući u vidu svoje supruge posebne strahove, do dolje, kao da bi jedan pokupiti i pitati, "hmm, Pitam se što je to?" (Be prepared for wife to body slam you as if she’s a secret service agent protecting the President from a sniper or you’ll find yourself laying on your back on the sidewalk).
  14. Drive twice around a parking lot looking for space. You know you’ve really hit pay dirt when your son in the back seat yells, "Oh no! He’s doing it opet!"
  15. Write "top 10" lists that don’t have 10 predmeti.

===

Bonus wife joke:

Two male co-workers go out to lunch. One of them tells the other, "I let loose an embarrassing Freudian slip the other night."

"A Freudian slip? What’s that?"

"Well, when we finished eating, the waitress came by and asked how we liked our meals. I meant say, ‘I loved the chicken breast’ but instead I said ‘I loved your breasts’. I was so embarrassed."

"Ah," his co-worker replied. "I had the same thing happen to me this weekend with my wife. We were eating breakfast I meant to ask her to pass the butter, but instead I screamed at her, ‘You ruined my life!'"

</kraj>

Technorati Tags:

Event ID 1023: “Windows ne može učitati brojač extensible MSSCNTRS DLL”

UPDATE (04/08/08): I seem to have solved this problem. From the command line, I ran "c:\windows system32 lodctr / R" po upis InstallShield govori o problemima i da se čini da su to riješiti za mene.

Primjetio sam da u zadnje vrijeme, my desktop/server fan never turns off. I know it used to turn off. I took a moment to check it out noticed that the a VMware process was running a consistent 20% utilization on one of the CPU’s. I checked the event log and saw these errors in the application log happening dozens of times per minute:

Windows ne može učitati Extensible Counter UGatherer DLL, Prvi DWORD u odjeljku podataka je kod Windows pogreške.

Windows ne može učitati Extensible Counter UGTHRSVC DLL, Prvi DWORD u odjeljku podataka je kod Windows pogreške.

Windows ne može učitati brojač extensible MSSCNTRS DLL, Prvi DWORD u odjeljku podataka je kod Windows pogreške.

Ako sam izbušiti u detalje jednom od tih poruka, JA dobiti to:

Izvor: Perflib

Tip: Pogreška

Kategorija: Nijedan

Event ID 1023

I did some research and there was some indication it could be a permission problem in terms of access to the DLLs in question. I played around with that stuff but could not affect things in a positive way so I gave up on that.

VMware su me prigovaralo o obavljanju update za neko vrijeme, pa sam upisao verziju sam instaliran (apparently "1.0.1 build 29996") and did the update. This upgraded me to v1.04. Nažalost, to nije riješila problem.

I can stop the insane number of messages going to my application log if I shut down a service named "VMware Authorization Service". This prevents me from using the VMware software, tako … not such a great option.

Domaćin operativni sustav Windows XP 64 bit.

Ja ne mislim da je ovo oduvijek bilo, , ali ne sjećam se da je bilo koji određeni događaj mogao dovesti do toga.

To je razlog zašto mrzim računala.

</kraj>

Technorati Tags:

Brz & Lako: Preimenovanje učitanu datoteku pomoću SharePoint Object Model putem Event prijemnik

UPDATE: This works but there are significant limitations which are described in the comments. This may still be useful in some cirumstances.

UPDATE 2: U mom trenutnom projektu, users always upload documents. Kao rezultat toga, I don’t run into a problem where MS Word is running and thinks that the file was renamed on it. I did run into a problem, "the file was modified by someone else" and solved this via a simple semaphore type flag. Users need to change a meta data field from its default value to something else. The itemupdated() prijemnik traži valjane vrijednosti tamo prije nego što zapravo obavljanje preimenovati i od tada, I have not had any problems. Your mileage may vary.

I have a client requirement to change the name of files uploaded to a specific document library to conform with a particular naming convention. The API does not provide a "rename()" način. Umjesto toga, koristimo "MoveTo(…)". Here is a minimal bit of code to accomplish this:

 javni nadjačati poništiti ItemAdded(SPItemEventProperties Svojstva)
        {
            SPFile f = properties.ListItem.File;

            f.MoveTo(properties.ListItem.ParentList.RootFolder.Url + "/xyzzy.doc");
            f.Update();

        }

The only tricky bit is the "properties.ListItem.ParentList.RootFolder.Url". The MoveTo() method requires a URL. That mashed up string points me to the root folder of my current document library. This allows me to avoid any hard coding in my event receiver.

To je više koristan verzija koja čini istu stvar, but assigns the name of the file to "Title":

 javni nadjačati poništiti ItemAdded(SPItemEventProperties Svojstva)
        {
            DisableEventFiring();

            // Dodjela naslov ove točke na naziv datoteke sama.
 // NAPOMENA: Ovaj zadatak se mora dogoditi prije izmijeniti datoteku.
 // Pozivanje ažuriranje() na SPFile čini se izgubiti u svojstvima
 // neki osjećaj.  Updates to "Title" nije do tog promjene (i ažuriranje() pozvati)
 // su se preselili ispred promjenu naziva datoteke.
            properties.ListItem["Title"] = Properties.ListItem.File.Name;

            properties.ListItem.Update();

            SPFile f = properties.ListItem.File;

            // Uzmite produljenje datoteke.  Trebamo kasnije.
 niz spfileExt = novi FileInfo(f.Name).Produžetak;

            // Promijenite naziv datoteke u popisu stavke ID i koristiti ekstenziju zadržati
 // da je dio njega netaknuti.
            f.MoveTo(properties.ListItem.ParentList.RootFolder.Url +
                "/" + properties.ListItem["ID"] + spfileExt);

            // Obvezati na potez.
            f.Update();

            EnableEventFiring();
        }

Rasprava forum: Provođenje Best Practices Usklađenost u Non-Trivial Moss okoliša

Kolega, "Mark", has started up a potentially interesting newsgroup discussion focusing on "establishing excellent SharePoint Governance from the start" za 35,000 upute za okoliš.

Rasprava je ovdje: http://groups.google.com/group/microsoft.public.sharepoint.portalserver/browse_thread/thread/6d9a738d981af772/1c390b15c5407db6?#1c390b15c5407db6

Pop na više i doprinose!

</kraj>

Custom URL akcija neće prikazati u novom značajkom

I’m still in the habit of crafting my feature XML files by hand since it’s all quite new to me. I don’t want to rely on a front-end tool that does stuff I don’t understand (kazao je kako je napisao blog zapis koristeći alat on ne razumije).

Danas, I was trying to add a custom action to the site settings but it just wouldn’t show up. I could install the feature and see it in the site features, ali kad sam ga aktivirati (bez greške) to jednostavno ne bi se pojaviti na padajućem izborniku.

I finally realized that I misspelled "SharePoint" Mjesto u atribut <CustomAction> čvor. This is the bad elements.xml file:

<?xml verzija="1.0" kodiranje="UTF-8" ?>
<Elementi xmlns="http://schemas.microsoft.com / SharePoint /">
  <CustomAction
 Id="SiteActionsToolbar"
 GroupId="SiteActions"
 Lokacija="Microsoft.Sharepoint.StandardMenu"
 Slijed="100"
 Naslov="Bok!"
 Opis="Custom izborniku Akcija dodao putem značajke."
 ImageUrl="_izgledi / slike / menuprofile.gif">

    <UrlAction Url="http://www.xyzzy.com"/>

  </CustomAction>
</Elementi>

Dobro:

<?xml verzija="1.0" kodiranje="UTF-8" ?>
<Elementi xmlns="http://schemas.microsoft.com / SharePoint /">
  <CustomAction
 Id="SiteActionsToolBar"
 GroupId="SiteActions"
 Lokacija="Microsoft.SharePoint.StandardMenu"
 Slijed="100"
 Naslov="Bok!"
 Opis="Custom izborniku Akcija dodao putem značajke."
    >
    <UrlAction Url="http://www.xyzzy.com"/>
  </CustomAction>
</Elementi>

That one took me a good two hours to figure out 🙂

Ja utjehu u činjenici da su neki dan u budućnosti, Ja ću biti u mogućnosti reći s uvjerenjem, "back in the day, Morao sam hodati tri milje do brda u snijegu (bos!) in order to deploy a custom feature to MOSS. You kids, ne znam kako se lako ga imate! Get off my lawn!"

Jedva čekam.

</kraj>

Technorati Tags: ,

Blog Stats

I thought some people might be interested in my blog’s statistics. You can use mine as a benchmark to compare your own.

I’m running my blog on windows live spaces. They collect stats for me and I don’t know any way to control that. It’s good as far as it goes, but it’s fairly limited in that I can’t do much actual analysis with it. I’d love, na primjer, to be able to generate a listing of my most frequently hit posts but I can’t do that without a prohibitive manual process. If someone knows better, molim vas recite mi.

Uživo prostori status mi reći: Ukupni hitovi za dan, total hits for the week and total hits since day zero. It also tells me what people did to get to my blog (e.g. Google, MSDN forum vezu, itd.).

Na neki način, a "hit" očito je. Ako čitate ovu rečenicu sada, ste gotovo sigurno registriran kao jedan hit.

RSS is a little confusing. On one hand, I see individual RSS hits all day long. Ali, I also see RSS "sweeps". A sweep is when I see 20 ili 30 RSS hits all within a one or two second window. I assume these are automated things like google checking in on my site, Možda tuđe preglednici … nisu sigurni. They are definitely some kind of automated process. I cannot tell, međutim, how many of my total hits are automated and how many have an actual human on the other side. I would guess at least 100 posjeta dnevno su automatizirani.

On s brojevima!

Sam napisao moj prvi blog post 27. srpnja, 2007.

Ja sam napisao otprilike 60 blog unosa od tada, više od 50 od kojih se izravno odnose na SharePoint.

Sam počeo pratiti od mojih pogodaka u tablicu na dnevnoj bazi, na kraju rujna.

Mjesečni Počinje:

Prvi tjedan: Ukupno Posjeta
Listopad 1,234
Studeni 2,162
Prosinac 3,071
Siječanj 2008 4,253

Ukupno po mjesecu

Mjesec Ukupno Posjeta
Listopad 6,620
Studeni 11,110
Prosinac 13,138

Visoke ocjene Voda

Tip Ukupno Posjeta
Najbolji dan 958
Najbolji Tjedan 4,253
Ukupno Posjeta od prvog dana Zero 42,438

Ja sam zainteresiran za druge’ stats. If you care to share yours in the comments, molim vas!

</kraj>

Technorati Tags:

U nedjelju ujutro Funny: “Da, da, da. Pretjerivanje, pretjerivanje, bla.”

Prije nekih šest godina, moj četverogodišnji sin i ja bili na katu gledajući Otkriće kanala "shark attacks" poseban (ova možda). He was very young at the point and I was always worried what he might see on a show like this and how he might take it. I didn’t want him to develop, na primjer, bilo koji posebni strahuje vode ili lani nešto neprimjereno svojim prijateljima, a možda i dovesti svoju mrežu beba prijatelju da se obruši.

Discovery handles these kinds of subjects very well. It’s not about creating a Strah od nešto, but rather to show how unusual it is for sharks to attack humans.

Tako, we’re watching it and there is this one particularly scary attack involving a small girl. As Discovery is building the drama of the attack, moj sin (koji je oduvijek bio iznimno nervozan ionako), is getting very excited. I make some noises about how unusual it is for sharks to attack people, and how bad the poor girl must feel. I’m trying to explain that people recover from these events and become stronger for it. Međutim, I had misinterpreted his excitement. He was not worried about the girl at all. Umjesto toga, dok je pljeskao rukama, on mi kaže, "The sharks love it! It’s terrific. It’s wonderful. Its a DREAM COME TRUE!"

Mislio sam da je ovo bio smiješan, but also very disturbing. U jednu ruku, Bilo mi je drago — čak i malo ponosni — da bi on mogao imati jake osjećaje empatije, cross-species though they may be. As humans, we need to develop our "empathic muscles" tako govore ili ćete završiti kao ovaj tip 🙂 On the other hand, he was feeling cross-species empathy toward a species who was exhibiting behavior inimical to his own. I was really struggling with this when the narrator used the word "paradigm". My son picked up on that and asked me what that meant.

To nije lako, kao riječ za opisati na četiri godine starim, but I gave it a try. When I think of the word "paradigm", Thomas Kuhn is never far from my thoughts. I read Struktura znanstvenih revolucija natrag na Lafayette i za bolje ili na gore, the word "paradigm" is pregnant with extra meaning for me. (Sort of like the word "contact" nakon što je čuo glas Telefon Film mi reći gdje sam mogao vidjeti taj film [Mislio sam da je knjiga bila bolja]; Ja uvijek kažem sebi, "CONTACT!" whenever I see or hear someone say "contact").

U svakom slučaju, Ja pokušavam objasniti mu Kuhnian razlučivosti, that it’s "a historical movement of thought" and that it’s a "way of thinking with a number of built-in assumptions that are hard to escape for people living at that time." Naravno, ne može razgovarati kao s četiri godišnja, so I’m trying to successively define it to smaller pieces and feeling rather proud of myself as I do so. (Upravo sam znali da je netko izvan sudačke će se brinuti da sam pročitao Kuhn!).

I’m just warming to the task when he interrupts me. Waving his hand u mom smjeru općeg i ne skidajući pogled s druge brutalnom napadu morskog psa, on samo kaže:, "Yeah, da, da. Pretjerivanje, pretjerivanje, blah.".

So much for that 🙂

U tom trenutku, Sam odlučio pobjeći, retorički govoreći, zasjesti, i uživati ​​gledajući morski psi napadaju ljude s mojim sinom.

</kraj>

Technorati Tags:

Prebacivanje Pogledajte View temelju korisničkog ID-u InfoPath obrasca

Imali smo razvili InfoPath obrazac s više pogleda kako bi podržao novi najam / on-boarding process. When the company hires a new person, IT odjel i druge skupine trebaju poduzeti akciju (postaviti plaće, omogućiti pristup odgovarajućim aplikacijama, locirati stol, itd.). We use on form but a different view of the form for each of those functions.

Na ovom mjestu, većina ljudi koji su uključeni u poslovnom procesu se IT-pamet, pa kad su pristupili obrazac, their default view is a "menu" view with buttons that direct them to their specific function. Međutim, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. Zapravo, ona bi trebao vidjeti samo jedan pogled na obrascu, a ne čak imati mogućnost vidjeti druge stavove.

U našem slučaju, da izravni upravitelja računa izravno vezan za obrasca ljubaznošću obratite selektor (which I am always wanting to call a "people picker" iz nekog razloga).

Koraci su sljedeći:

1. U načinu dizajna, idite na Tools -> Obrazac Options -> Otvori i Spremi.

2. Select "rules".

3. Create a new rule whose action is "switch to view" , a čije stanje utjecati na korisničko ime() funkcija.

userName() returns the "simple" user name without the domain. If I log into SharePoint with credentials "domain\pagalvin", userName() returns "pagalvin".

The contact selector provides three bits of information for a contact. The "AccountID" portion is most useful for this scenario. The only thing that makes this even a little bit of challenge is that the contact selector (u mom okruženju ionako) vraća domenu i korisnički ID, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("domain\pagalvin") nikada neće biti jednak korisničko ime() ("pagalvin").

We can get around this using the "contains" operator: AccountID sadrži korisničko ime().

Možemo uzeti ga dalje i pre-daj hard-kodirana domene ispred korisničko ime() funkcionirati da se naša jednakost provjeriti i eliminirati rizik od lažno pozitivan na sadrži operatoru.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Na primjer, when a member of the "IT Analytics" Skupina pristupa obrazac, automatically switch to the IT Analytics view. We didn’t have time to implement it, but my first thought is to create a web service that would have a method like "IsMemberOfActiveDirectorySecurityGroup", prođe to userName() and return back true or false. Does anyone have any other, pametnija ideja? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</kraj>

Technorati Tags:

Slučajno Dodavanje kod na InfoPath obrasca; Namjerno maknuti

Prilikom rada s gumbima na obrascu, we often add rules. You access the rules editor from the properties of the button.

Kad kliknete oko brzo, it’s easy to accidentally click on "Edit Form Code" instead of "Rules …".

Prvi put sam to učinio, I canceled out of the code editor. Međutim, kada sam pokušao objaviti obrazac malo kasnije, it required that I publish as an "Administrator-approved form template (napredan)". I didn’t actually do any programming and I absolutely didn’t want to go through an unnecessary approval process. I was in a bit of panic at the time due to time constraints. To get past it, I simply restored a previous backup and continued. I had recently seen some blog posts about people going into the form’s XML to tweak things and I was afraid I would have to do something similar.

Danas, I did it again. Ovaj puta, Imao sam malo više vremena na rukama i otkrili da možete lako poništiti.

Idite na:

Alati -> Obrazac Options -> Programiranje: "Remove Code"

To ne bi puno lakše nego da.

</kraj>

Technorati Tags: ,