Oplossing vir Probleem: “FileNotFoundException” Met my Feature Ontvanger.

I was working on a feature last week that would add some event receivers to a specific list instance. (Ek blog 'n bietjie oor daardie lys ontvanger hier).

Met die opdrag, Ek kon die funksie met geen fout installeer (maar sien hieronder vir die verborge fout). When I tried to deploy the feature on the site, MOSS complained of a "FileNotFoundException" fout. This blog entry describes how I solved it.

Dit is die fout wat MOSS het vir my gewys in die webblaaier:

Feature ‘b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ could not be installed because the loading of event receiver assembly "xyzzyFeatureReceiver_0" misluk: System.IO.FileNotFoundException: Could not load file or assembly ‘xyzzyFeatureReceiver_0’ of een van sy afhanklikhede. Die stelsel kan nie vind die gekose lêer.
File name: ‘xyzzyFeatureReceiver_0’
at System.Reflection.Assembly.nLoad(AssemblyName lêernaam, String kodebasis, Getuienis assemblySecurity, Vergadering locationHint, StackCrawlMark& stackMark, Boole throwOnFileNotFound, Boole forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Getuienis assemblySecurity, StackCrawlMark& stackMark, Boole forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Getuienis assemblySecurity, StackCrawlMark& stackMark, Boole forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Vergadering binding registrasie is afgeskakel.
Vergadering bind mislukking versuip in staat te stel om, stel die register waarde [HKLM Software Microsoft Fusion!EnableLog] (DWORD) aan 1.
Let daarop: Daar is 'n prestasie straf wat verband hou met die vergadering bind versuim om te meld.
Om hierdie funksie af te skakel, verwyder die register waarde [HKLM Software Microsoft Fusion!EnableLog].

Oplos van probleme met kwessies met Windows SharePoint Services.

Ek weet hoe om doelbewus veroorsaak dat die fout: don’t install the assembly in the GAC. Maar, 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% gemaklik om dit te doen, want ek het nog altyd gedink dat gacutil bestaan ​​vir 'n rede … so I tried that. It made no difference.

Ek het die Inter en het gevind dat hierdie post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

Die plakkaat gebeur te word met behulp van dieselfde wortel bietjie van die kode (van die binnekant van WSS boek van hierdie lys) so that was a hopeful sign. Egter, die voorstel van die versiering van die vergadering met 'n [vergadering: ] 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.

Volgende, I went to the trouble of enabling the "assembly bind failure log" (na aanleiding van die hulpvaardig en akkurate instruksies) 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. Maar … dit sal nie soek vir dit in die 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" funksie b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: Waarde kan nie nul wees.
Parameter naam: tipe
at System.Activator.CreateInstance(Tik, Boole nonPublic)
at System.Activator.CreateInstance(Tik)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Oplos van probleme met kwessies met Windows SharePoint Services.

Tyd vir 'n laaste reis na die Inter!

Hierdie keer het ek uitvind, voorspelbaar genoeg, that MOSS issues this error because the assembly is not in GAC.

Ek wil iets positiefs uit te kry en probeer om te voel 'n bietjie trots op die feit dat ek geskep het Die Fugitive van MSIL gemeentes, but it’s not working. I’m just plain annoyed. I find myself muttering "chicken or the egg" onder my asem.

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" maar kan nie vind een).

Ek installering van die funksie en dit aktiveer en … dit werk! So, na al, I had to basically ‘reboot’ my project. Dit is 'n ander rede waarom ek haat rekenaars.

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. Vir een of ander rede, I did not use the -force option when I installed the new project. Hierdie keer, Ek het eintlik, truly forget to copy this new project’s assembly into the GAC. As 'n gevolg, I received that "FielNotFoundException" fout. Hierdie keer, Ek het dit van stsadm, not when I tried to activate the feature via the web browser. So, -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.

</einde>

Sondag Funny: Top 10 Maniere om jou vrou te vererg

  1. Koop broccoli as jy weet daar is reeds meer as genoeg in die yskas.
  2. Go for a run. Cool off. Take off clean pillow case and replace with T-shirt. Cover with clean pillow case.
  3. Wanneer jy bestuur, vra of ons moet op die verkeerde manier gaan 'n eenrigting-straat af.
  4. Vir 15 jaar, every Sunday that you wife suggests going to a museum, express surprise that museums are open on Sunday’s.
  5. Vir 15 jaar, occasionally suggest going to the local book store on Sunday. Express surprise that they are not open on Sunday’s (thanks a lot Blue Laws!).
  6. Gebruik 20 points to do a 3 point turn.
  7. On a cool early Fall afternoon, 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, silly" and gets up to turn it off, grab the warm spot she had on the couch. Bonus points if she does not realize you did it until much later.
  8. Open up a can of delicious white albacore tuna and eat it straight from the can, in bed, at night.
  9. Go into the kitchen while wife is eating dinner, open up the cutlery drawer and push utensils around until wife screams, "what are you looking for!"
  10. On receipt of new business cards, secretly place them all around the house: Under the bed, in pillow cases, inside coffee cups, in her purse, in coat pockets, car glove compartments, the pantry — anywhere you can think of.
  11. Write blog entries about your wife.
  12. Wake up.
  13. When walking the streets of New York City, be on the alert for "crusty" objects on the ground. Keeping in mind your wife’s special fears, reach down as if to pick one up up and ask, "hmm, I wonder what that is?" (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 weer!"
  15. Write "top 10" lists that don’t have 10 items.

===

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!""

</einde>

Technorati Tags:

Event ID 1023: “Windows kan nie laai nie extensible toonbank DLL MSSCNTRS”

UPDATE (04/08/08): I seem to have solved this problem. From the command line, Ek het "C:\windows system32 lodctr / R" soos per 'n inskrywing praat oor Install probleme en dit blyk opgelos het dit vir my.

Ek het wat die afgelope tyd opgemerk, 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 kan nie laai extensible toonbank DLL UGatherer, die eerste DWORD in data-afdeling is die Windows fout kode.

Windows kan nie laai extensible toonbank DLL UGTHRSVC, die eerste DWORD in data-afdeling is die Windows fout kode.

Windows kan nie laai nie extensible toonbank DLL MSSCNTRS, die eerste DWORD in data-afdeling is die Windows fout kode.

As ek boor in die besonderhede van een van die boodskappe, Ek kry hierdie:

Bron: Perflib

Tipe: Fout

Kategorie: Geen

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 had been nagging me about performing an update for quite some time, so I jotted down the version I had installed (apparently "1.0.1 build 29996") and did the update. This upgraded me to v1.04. Ongelukkig, it did not fix the issue.

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, so … not such a great option.

The host operating system is Windows XP 64 bietjie.

Ek dink nie dit was nog altyd gebeur, maar ek kan nie onthou dat enige spesifieke gebeurtenis wat kan dit daartoe gelei het.

Dit is waarom ek haat rekenaars.

</einde>

Technorati Tags:

Vinnige & Maklik: Herbenoem Opgelaai lêer SharePoint Object Model Via 'n gebeurtenis Ontvanger

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

UPDATE 2: In my huidige projek, users always upload documents. As 'n gevolg, 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() receiver looks for a valid value there before actually performing the rename and since then, 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()" metode. In plaas daarvan, we use "MoveTo(…)". Here is a minimal bit of code to accomplish this:

 openbare oorheers nietig ItemAdded(SPItemEventProperties eienskappe)
        {
            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.

This is a more useful version that does the same thing, but assigns the name of the file to "Title":

 openbare oorheers nietig ItemAdded(SPItemEventProperties eienskappe)
        {
            DisableEventFiring();

            // Assign the title of this item to the name of file itself.
 // NOTA: This assignment must take place before we modify the file itself.
 // Calling update() on the SPFile seems to invalidate the properties in
 // some sense.  Updates to "Title" failed until that change (and update() call)
 // were moved in front of the change to the file name.
            properties.ListItem["Title"] = properties.ListItem.File.Name;

            properties.ListItem.Update();

            SPFile f = properties.ListItem.File;

            // Get the extension of the file.  We need that later.
 string spfileExt = nuwe FileInfo(f.Name).Extension;

            // Rename the file to the list item's ID and use the file extension to keep
 // that part of it intact.
            f.MoveTo(properties.ListItem.ParentList.RootFolder.Url +
                "/" + properties.ListItem["ID"] + spfileExt);

            // Commit the move.
            f.Update();

            EnableEventFiring();
        }

Discussion: Toepassing van Beste Praktyke nakoming in 'n nie-triviale mos Omgewing

'N mede, "Mark", het begin met 'n potensieel interessante nuusgroep bespreking fokus op "die stigting van 'n uitstekende SharePoint Bestuur van die begin af" vir 'n 35,000 gebruiker omgewing.

Die gesprek is hier: http://groups.google.com/group/microsoft.public.sharepoint.portalserver/browse_thread/thread/6d9a738d981af772/1c390b15c5407db6?#1c390b15c5407db6

Pop op meer as en dra!

</einde>

URL van persoonlike aksie word nie vertoon vir die Nuwe funksie

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 (Hy het gesê hy het 'n blog inskrywing met behulp van 'n instrument hy nie verstaan ​​nie).

Vandag, 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, maar toe ek dit geaktiveer (sonder foute) dit eenvoudig nie wys op die drop-down menu.

I finally realized that I misspelled "SharePoint" in die area kenmerk van die <CustomAction> node. This is the bad elements.xml file:

<?xml weergawe="1.0" encoding="UTF-8" ?>
<Elemente xmlns="http://schemas.microsoft.com / SharePoint /">
  <CustomAction
 Id="SiteActionsToolbar"
 Groepid="SiteActions"
 Plek="Microsoft.Sharepoint.StandardMenu"
 Volgorde="100"
 Titel="Hallo!"
 Description="Custom menu aksie bygevoeg via 'n funksie."
 ImageUrl="_layouts / images / menuprofile.gif">

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

  </CustomAction>
</Elemente>

Goeie:

<?xml weergawe="1.0" encoding="UTF-8" ?>
<Elemente xmlns="http://schemas.microsoft.com / SharePoint /">
  <CustomAction
 Id="SiteActionsToolBar"
 Groepid="SiteActions"
 Plek="Microsoft.SharePoint.StandardMenu"
 Volgorde="100"
 Titel="Hallo!"
 Description="Custom menu aksie bygevoeg via 'n funksie."
    >
    <UrlAction Url="http://www.xyzzy.com"/>
  </CustomAction>
</Elemente>

Daardie een het my 'n goeie twee uur geneem om uit te vind 🙂

Ek troos in die feit dat 'n dag in die toekoms, Ek sal in staat wees om te sê met oortuiging, "back in the day, Ek het drie myl te loop heuwel in die sneeu (kaalvoet!) in order to deploy a custom feature to MOSS. You kids, jy weet nie hoe maklik jy dit! Get off my lawn!"

Kan nie wag.

</einde>

Technorati Tags: ,

Cryoprobe

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, byvoorbeeld, 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, asseblief vir my sê.

Live ruimtes status vertel my: Totale kere vir die dag, total hits for the week and total hits since day zero. It also tells me what people did to get to my blog (bijv. Google, MSDN forum skakel, ens.).

In sommige maniere, a "hit" is voor die hand liggend. As jy dit lees hierdie sin nou, jy het amper sekerlik geregistreer as 'n enkele treffer.

RSS is a little confusing. On one hand, I see individual RSS hits all day long. Maar, I also see RSS "sweeps". A sweep is when I see 20 of 30 RSS hits all within a one or two second window. I assume these are automated things like google checking in on my site, miskien ander mense se bruisers … not sure. They are definitely some kind of automated process. I cannot tell, egter, 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 hits per dag is outomaties.

Op die nommers!

Ek het my eerste blog inskrywing op 27 Julie, 2007.

Ek het ongeveer geskryf 60 blog inskrywings sedertdien, meer as 50 wat direk verband hou met SharePoint.

Ek het begin om tred te hou van my treffers in 'n sigblad op 'n daaglikse basis aan die einde van September.

Maandelikse Vanaf:

Eerste week van: Totale kere
Oktober 1,234
November 2,162
Desember 3,071
Januarie 2008 4,253

Totale per maand

Maand Totale kere
Oktober 6,620
November 11,110
Desember 13,138

Hoë Water Marks

Tipe Totale kere
Beste dag 958
Beste Week 4,253
Totale kere Sedert Day Zero 42,438

Ek is geïnteresseerd in ander’ stats. If you care to share yours in the comments, doen asseblief!

</einde>

Technorati Tags:

Sondagoggend Funny: “Ja, ja, ja. Blah, blah, blah.”

Sowat ses jaar gelede, my vier-jarige seun en ek is bo kyk na 'n Discovery-kanaal "shark attacks" spesiale (moontlik hierdie een). 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, byvoorbeeld, 'n spesiale vrese van die water of klappen iets onvanpas aan sy vriende en moontlik veroorsaak dat sy baba vriend netwerk te kom gekraak.

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

So, 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, my klank (wat nog altyd baie senuweeagtig in elk geval), 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. Egter, I had misinterpreted his excitement. He was not worried about the girl at all. In plaas daarvan, terwyl klap sy hande, Hy sê vir my, "The sharks love it! It’s terrific. It’s wonderful. Its a DREAM COME TRUE!"

Ek het gedink dit was hilarious, but also very disturbing. Aan die een kant, Ek was bly — selfs 'n bietjie trots — dat hy het 'n sterk empatiese gevoelens, cross-species though they may be. As humans, we need to develop our "empathic muscles" so praat, of jy sal uiteindelik soos hierdie man 🙂 Aan die ander kant, 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.

That’s not such an easy word to describe to a four year old, but I gave it a try. When I think of the word "paradigm", Thomas Kuhn is never far from my thoughts. Ek lees The Structure of Scientific Revolutions back at Lafayette and for better or for worse, the word "paradigm" is pregnant with extra meaning for me. (Sort of like the word "contact" after hearing a Movie Phone voice tell me where I could see that movie [I thought the book was better]; I always say to myself, "CONTACT!" whenever I see or hear someone say "contact").

In elk geval, Ek probeer om te verduidelik aan hom 'n Kuhniaanse definisie, 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." Natuurlik, jy kan nie praat soos met 'n vier-jaar oud, so I’m trying to successively define it to smaller pieces and feeling rather proud of myself as I do so. (Ek het net geweet dat iemand buite van die kollege sal sorg dat ek Kuhn het gelees!).

I’m just warming to the task when he interrupts me. Waving his hand in my algemene rigting en nooit om sy oë uit 'n ander wrede haai-aanval, Hy sê net, "Yeah, ja, ja. Blah, blah, blah.".

Soveel daarvoor 🙂

Op daardie stadium, I decided to run away, rhetorically speaking, sit back, and enjoy watching sharks attack humans with my son.

</einde>

Technorati Tags:

Skakel skerm op grond van gebruikers ID in 'n Path vorm

Ons het 'n ontwikkelde 'n Path vorm 'n nuwe huur met verskeie standpunte te ondersteun. / on-boarding process. When the company hires a new person, die IT-departement en ander groepe nodig om aksie te neem (op die betaalstaat, in staat stel om toegang tot toepaslike programme, soek 'n lessenaar, ens.). We use on form but a different view of the form for each of those functions.

Op hierdie maatskappy, Die meeste van die mense wat betrokke is in die besigheid is IT-vaardig, so wanneer hulle toegang tot die vorm, hulle op die regte pad is 'n "menu" view with buttons that direct them to their specific function. Egter, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. In werklikheid, sy moet net een siening van die vorm en nie eens 'n opsie om die ander mening te sien.

In ons geval, dat direkte bestuurder se rekening word direk gekoppel aan die vergunning van 'n kontak selector (wat ek wil altyd 'n "mense picker te roep" vir een of ander rede).

Die stappe is soos volg:

1. In die ontwerp af, Gaan na Tools -> Vorm opsies -> Oopmaak en stoor.

2. Kies "reëls".

3. Skep 'n nuwe reël wie se optrede is "skakel om te sien" en wie se toestand maak gebruik van die gebruikersnaam() funksie.

gebruikersnaam() gee die "eenvoudige" user name without the domain. If I log into SharePoint with credentials "domain\pagalvin", gebruikersnaam() return "kussings".

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 (in elk geval in my omgewing) gee die domein en gebruikers ID, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("Domain kussing") sal nooit gelyk gebruikersnaam() ("Pillow").

Ons kan kry om die gebruik van die "bevat" operateur: AccountID bevat gebruikersnaam().

Ons kan dit verder en pre-pend 'n harde-gekodeerde gebied in die voorkant van die gebruikersnaam() funksie te kry gaan ons gelykheid en elimineer die risiko van 'n vals positief op die bevat operateur.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Byvoorbeeld, Wanneer 'n lid van die "IT Analytics" groep toegang tot die vorm, automatically switch to the IT Analytics view. We didn’t have time to implement it, maar my eerste gedagte is om 'n web te skep wat 'n metode soos "IsMemberOfActiveDirectorySecurityGroup", slaag dit die gebruikersnaam() and return back true or false. Does anyone have any other, meer slim idee? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</einde>

Technorati Tags:

Per ongeluk Voeg Kode aan 'n Path vorm; Doelbewus verwydering van

By die werk met knoppies op 'n vorm, we often add rules. You access the rules editor from the properties of the button.

Wanneer te kliek rond vinnig, it’s easy to accidentally click on "Edit Form Code" instead of "Rules …".

Die eerste keer dat ek dit gedoen het, I canceled out of the code editor. Egter, wanneer ek probeer om die vorm na 'n rukkie later publiseer, it required that I publish as an "Administrator-approved form template (gevorderde)". 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.

Vandag, I did it again. Hierdie keer, Ek het 'n bietjie meer tyd op my hande en gevind dat jy dit maklik kan maak dit ongedaan.

Gaan na:

Gereedskap -> Vorm opsies -> Programmering: "Remove Code"

Dit raak nie veel makliker as dit.

</einde>

Technorati Tags: ,