Lausn á vandamáli: “FileNotFoundException” Með Receiver eiginleiki minn.

I was working on a feature last week that would add some event receivers to a specific list instance. (Ég bloggaði aðeins um að lista móttakara hér).

Using the stjórn lína, Ég gæti sett aðgerðina án villa (en sjá hér fyrir falinn villa). When I tried to deploy the feature on the site, MOSS complained of a "FileNotFoundException" villa. This blog entry describes how I solved it.

Þetta er villa sem MOSS sýndi mér í vafranum:

Feature ‘b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ could not be installed because the loading of event receiver assembly "xyzzyFeatureReceiver_0" mistókst: System.IO.FileNotFoundException: Could not load file or assembly ‘xyzzyFeatureReceiver_0’ eða eitt af ósjálfstæði. The kerfi geta ekki finna the skrá sem tilgreind.
Skrá nafn: ‘xyzzyFeatureReceiver_0’
at System.Reflection.Assembly.nLoad(AssemblyName filename, String codebase, Sönnun assemblySecurity, Samkoma locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Sönnun assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Sönnun assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Samkoma bindandi skógarhögg er slökkt.
Til að gera samkoma binda bilun skógarhögg, stilla skrásetning gildi [HKLM Software Microsoft Fusion!EnableLog] (DWORD) að 1.
Athugaðu: Það er einhver árangur refsing tengist samkoma binda bilun skógarhögg.
Til að kveikja þennan eiginleika af, fjarlægja skrásetning gildi [HKLM Software Microsoft Fusion!EnableLog].

Leysa mál með Windows SharePoint Services.

Ég veit hvernig á að vísvitandi valda þessi villa: don’t install the assembly in the GAC. En, 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% þægilegt að gera það vegna þess að ég hélt alltaf að gacutil verið fyrir ástæðu … so I tried that. It made no difference.

Ég leitaði internets og fann þessa færslu: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

Plakat varð að nota sömu rót hluti af kóða (innan frá WSS bók frá þessum lista) so that was a hopeful sign. Hins, tillögu að skreyta söfnuðinum með að [samkoma: ] 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.

Næsta, I went to the trouble of enabling the "assembly bind failure log" (fylgja gagnlegar og nákvæmar leiðbeiningar sem kveðið) 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. En … það mun ekki leita að því í 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" fyrir lögun b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: Gildi getur ekki verið tómt.
Viðfang nafn: tegund
at System.Activator.CreateInstance(Tegund gerð, Boolean eru almenn)
at System.Activator.CreateInstance(Tegund gerð)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Leysa mál með Windows SharePoint Services.

Tími fyrir eitt síðasta ferð til Internets!

Þessi skipti sem ég fundið út, áreiðanlega nóg, that MOSS issues this error because the assembly is not in GAC.

Ég vil fá eitthvað jákvætt út úr þessu og reyna að finna smá stolt af því að ég hef búið á Landflótta af MSIL þingum, but it’s not working. I’m just plain annoyed. I find myself muttering "chicken or the egg" undir anda minn.

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" en getur ekki fundið einn).

Ég setja lögun og virkja það og … það virkar! Svo, eftir allt að, I had to basically ‘reboot’ my project. Þetta er önnur ástæðan af hverju ég hata tölvur.

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. For some reason, I did not use the -force option when I installed the new project. Í þetta sinn, Ég gerði í raun, truly forget to copy this new project’s assembly into the GAC. Þar af leiðandi, I received that "FielNotFoundException" villa. Í þetta sinn, Ég fékk það frá stsadm, not when I tried to activate the feature via the web browser. Svo, -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.

</enda>

Technorati Tags: ,

Sunnudagur Fyndið: Top 10 Leiðir til að ónáða konuna þína

  1. Kaupa spergilkál þegar þú veist að það er þegar meira en nóg í ísskápnum.
  2. Go for a run. Cool off. Take off clean pillow case and replace with T-shirt. Cover with clean pillow case.
  3. Við akstur, spyrja hvort við ættum að fara á rangan hátt niður einn-vegur götu.
  4. Fyrir 15 ár, every Sunday that you wife suggests going to a museum, express surprise that museums are open on Sunday’s.
  5. Fyrir 15 ár, 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. Nota 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 aftur!"
  15. Write "top 10" lists that don’t have 10 atriði.

===

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

</enda>

Technorati Tags:

Event ID 1023: “Windows getur ekki hlaða teygjanlegur gegn MSSCNTRS DLL”

UPDATE (04/08/08): I seem to have solved this problem. From the command line, I ran "c:\Windows system32 lodctr / R" eins og á færslu tala um InstallShield vandamál og það virðist hafa leyst það fyrir mig.

Ég hef tekið eftir því að undanfarið, 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 getur ekki hlaða extensible counter DLL UGatherer, fyrsta DWORD í gögnum kafla er Windows villa.

Windows getur ekki hlaða extensible counter DLL UGTHRSVC, fyrsta DWORD í gögnum kafla er Windows villa.

Windows getur ekki hlaða teygjanlegur gegn MSSCNTRS DLL, fyrsta DWORD í gögnum kafla er Windows villa.

Ef ég bora inn upplýsingar um einn af þeim skilaboðum, Ég fæ þetta:

Heimild: Perflib

Tegund: Villa

Flokkur: Ekkert

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 hafði verið nöldrari mig um að framkvæma uppfærslu fyrir alveg sumir tími, svo ég jotted niður útgáfu ég hafði sett (apparently "1.0.1 build 29996") and did the update. This upgraded me to v1.04. Því miður, það var ekki festa the tölublað.

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

The gestgjafi stýrikerfi er Windows XP 64 hluti.

Ég held ekki að þetta hefur alltaf gerst, en ég man ekki neina sérstaka atburði sem gæti hafa leitt til þess.

Þetta er ástæða þess að ég hata tölvur.

</enda>

Technorati Tags:

Quick & Easy: Endurnefna skrá innsend nota SharePoint Object Model gegnum Event Receiver

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

UPDATE 2: Í núverandi verkefni mitt, users always upload documents. Þar af leiðandi, 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() móttökutæki útlit fyrir gilt gildi þar áður en þeir framkvæma endurnefna og síðan þá, 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()" aðferð. Staðinn, við notum "MoveTo(…)". Here is a minimal bit of code to accomplish this:

 almennings forgang ógilt ItemAdded(SPItemEventProperties eignir)
        {
            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.

Þetta er meira gagni útgáfa þessi hjartarskinn the sami hlutur, but assigns the name of the file to "Title":

 almennings forgang ógilt ItemAdded(SPItemEventProperties eignir)
        {
            DisableEventFiring();

            // Úthluta titilinn á þessu atriði á nafni skrá sig.
 // ATHUGIÐ: Þessi verkefni þarf að fara fram áður en við breytt skránni sjálfri.
 // Starf uppfærslu() á SPFile virðist ógilda eiginleika í
 // sumir skilningarvit.  Updates to "Title" ekki fyrr en þessi breyting (og uppfæra() hringja)
 // voru flutt í framan the breyting til the skrá nafn.
            properties.ListItem["Title"] = Properties.ListItem.File.Name;

            properties.ListItem.Update();

            SPFile f = properties.ListItem.File;

            // Fá framlengingu á skrá.  Við þurfum að síðar.
 band spfileExt =  FileInfo(f.Name).Framlenging;

            // Endurnefna skrána til ID á lista yfir atriði og nota skrá eftirnafn til að halda
 // að hluti af því ósnortinn.
            f.MoveTo(properties.ListItem.ParentList.RootFolder.Url +
                "/" + properties.ListItem["ID"] + spfileExt);

            // Skuldbinda færa.
            f.Update();

            EnableEventFiring();
        }

Forum Umræður: Framfylgja Best Practices Fylgni á ekki léttvæg mosa Umhverfi

A náungi, "Mark", has started up a potentially interesting newsgroup discussion focusing on "establishing excellent SharePoint Governance from the start" fyrir 35,000 notandi umhverfi.

Umfjöllunin er hér: http://groups.google.com/group/microsoft.public.sharepoint.portalserver/browse_thread/thread/6d9a738d981af772/1c390b15c5407db6?#1c390b15c5407db6

Skjóta á yfir og stuðla!

</enda>

Custom Action URL mun ekki birta fyrir nýr lögun

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 (sagði hann eins og hann skrifaði bloggfærslu nota tól Hann skilur ekki).

Í dag, 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, en þegar ég virkja það (án villa) það einfaldlega myndi ekki mæta á the falla-dúnn matseðill.

I finally realized that I misspelled "SharePoint" í stað eigindi <CustomAction> hnút. This is the bad elements.xml file:

<?XML útgáfa="1.0" Kóðun="UTF-8" ?>
<Elements xmlns="HTTP://schemas.microsoft.com / SharePoint /">
  <CustomAction
 Id="SiteActionsToolbar"
 GroupId="SiteActions"
 Staðsetning="Microsoft.Sharepoint.StandardMenu"
 Sequence="100"
 Titill="Halló!"
 Lýsing="Custom matseðill aðgerð bætt við með lögun."
 ImageUrl="_layouts / images / menuprofile.gif">

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

  </CustomAction>
</Elements>

Good:

<?XML útgáfa="1.0" Kóðun="UTF-8" ?>
<Elements xmlns="HTTP://schemas.microsoft.com / SharePoint /">
  <CustomAction
 Id="SiteActionsToolBar"
 GroupId="SiteActions"
 Staðsetning="Microsoft.SharePoint.StandardMenu"
 Sequence="100"
 Titill="Halló!"
 Lýsing="Custom matseðill aðgerð bætt við með lögun."
    >
    <UrlAction Url="HTTP://www.xyzzy.com"/>
  </CustomAction>
</Elements>

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

Ég tek huggun í þeirri staðreynd að einn daginn í framtíðinni, Ég skal vera fær um að segja með sannfæringu, "back in the day, Ég þurfti að ganga þrjá kílómetra upp hæð í snjónum (berfættur!) in order to deploy a custom feature to MOSS. You kids, þú veist ekki hversu auðvelt þú hefur það! Get off my lawn!"

Get ekki beðið.

</enda>

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, til dæmis, 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, please tell me.

Live spaces status tell me: total hits for the day, 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 link, o.fl.).

In some ways, a "hit" er augljóst. If you’re reading this sentence right now, you’ve almost certainly registered as a single hit.

RSS is a little confusing. On one hand, I see individual RSS hits all day long. En, I also see RSS "sweeps". A sweep is when I see 20 eða 30 RSS hits all within a one or two second window. I assume these are automated things like google checking in on my site, vafra kannski annars fólks … not sure. They are definitely some kind of automated process. I cannot tell, þó, 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 smellir á dag eru sjálfvirk.

Á að tölurnar!

Ég skrifaði fyrstu bloggfærslu mína á júlí 27, 2007.

Ég hef skrifað um 60 bloggfærslur síðan, meira en 50 sem tengjast beint til SharePoint.

Ég byrjaði að halda utan um af hits mínum í töflureikni á hverjum degi í lok september.

Mánaðarlega Byrjar:

Fyrstu viku: Total Hits
Október 1,234
Nóvember 2,162
Desember 3,071
Janúar 2008 4,253

Samtals mánuð

Mánuður Total Hits
Október 6,620
Nóvember 11,110
Desember 13,138

High Marks Water

Tegund Total Hits
Best Day 958
Best Vika 4,253
Total Hits frá fyrsta degi Zero 42,438

Ég hef áhuga á öðrum’ stats. If you care to share yours in the comments, skaltu ekki!

</enda>

Technorati Tags:

Sunnudagsmorgun Funny: “Já, já, já. Blah, bla, bla.”

Um sex árum síðan, fjögurra ára sonur minn og ég vorum uppi að horfa á Discovery Channel "shark attacks" sérstakt (hugsanlega þetta). 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, til dæmis, allir sérstök ótta að vatni eða blab eitthvað óviðeigandi við vini sína og hugsanlega valdið barn vin net sitt til að koma hrun niður.

Discovery handles these kinds of subjects very well. It’s not about creating a ótti við eitthvað, but rather to show how unusual it is for sharks to attack humans.

Svo, 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, sonur minn (sem hefur alltaf verið mjög jumpy samt), 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. Hins, I had misinterpreted his excitement. He was not worried about the girl at all. Staðinn, en clapping hendur hans, hann segir mér, "The sharks love it! It’s terrific. It’s wonderful. Its a DREAM COME TRUE!"

Ég hélt að þetta væri fyndið, but also very disturbing. On the one hand, Ég var fegin — jafnvel smá stolt — að hann gæti hafa sterkar empathic tilfinningar, cross-species though they may be. As humans, we need to develop our "empathic muscles" svo tala eða þú munt á endanum eins og þessi strákur 🙂 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.

Það er ekki svo auðvelt orð til að lýsa til fjögurra ára, but I gave it a try. When I think of the word "paradigm", Thomas Kuhn is never far from my thoughts. Ég las Uppbygging Scientific byltingum aftur á Lafayette og fyrir betri eða verri, the word "paradigm" is pregnant with extra meaning for me. (Sort of like the word "contact" eftir að hafa heyrt Sími Movie rödd segja mér hvar ég gæti séð sem bíómynd [Ég hélt að bókin var betri]; Ég segi alltaf við sjálfan mig, "CONTACT!" whenever I see or hear someone say "contact").

Engu að síður, Ég er að reyna að útskýra fyrir honum Kuhnian skýring, 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." Auðvitað, þú getur ekki talað eins til fjögurra ára, so I’m trying to successively define it to smaller pieces and feeling rather proud of myself as I do so. (Ég bara vissi að einhver utan háskóla myndi hugsa að ég hefði lesið Kuhn!).

I’m just warming to the task when he interrupts me. Waving his hand almennt átt minn og aldrei taka augun af öðru grimmur hákarl árás, hann segir bara, "Yeah, já, já. Blah, bla, blah.".

So much for that 🙂

At that point, I decided to run away, rhetorically speaking, sit back, and enjoy watching sharks attack humans with my son.

</enda>

Technorati Tags:

Skipta View Skoða Byggt á auðkenni notanda í An Infopath Form

Við höfðum þróað með InfoPath form með mörgum útsýni til að styðja nýja ráða / on-boarding process. When the company hires a new person, The IT deild og aðrir hópar þurfa að grípa til aðgerða (setja upp launaskrá, virkja aðgang að viðeigandi forritum, finna skrifborð, o.fl.). We use on form but a different view of the form for each of those functions.

Á þetta fyrirtæki, flestir sem taka þátt í viðskiptum ferli eru IT-kunnátta, svo þegar þeir opna mynd, their default view is a "menu" view with buttons that direct them to their specific function. Hins, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. Í raun, hún ætti að sjá bara einn mynd af formi og ekki einu sinni kost að sjá aðra skoðanir.

Í okkar tilviki, að reikningur beinni stjórnanda er beint tied til mynd kurteisi af a samband val (which I am always wanting to call a "people picker" fyrir sumir ástæða).

Skrefin eru eftirfarandi:

1. Í ham hönnun, fara í Tools -> Form Valkostir -> Opinn og Vista.

2. Select "rules".

3. Create a new rule whose action is "switch to view" og þar sem ástand notar Notendanafnið() virka.

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 (í umhverfi mínu samt) skilar ríki og Aðgangsorð notanda, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("domain\pagalvin") mun aldrei jafna notandanafn() ("pagalvin").

We can get around this using the "contains" rekstraraðila: AccountID inniheldur notandanafn().

Við getum tekið það frekar og pre-pend a harður-dulmáli ríki framan notandanafn() virka til að fá jafnrétti athuga okkar og koma í veg fyrir hættu á falskur jákvæður á inniheldur rekstraraðila.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Til dæmis, when a member of the "IT Analytics" Hópurinn notar mynd, 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", standast það username() and return back true or false. Does anyone have any other, meira snjall hugmynd? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</enda>

Technorati Tags:

Tilviljun bæta kóða til Infopath Form; Vísvitandi fjarlægt það

Þegar unnið er með hnöppum á mynd, we often add rules. You access the rules editor from the properties of the button.

Þegar smellt kring fljótt, it’s easy to accidentally click on "Edit Form Code" instead of "Rules …".

Í fyrsta skipti sem ég gerði þetta, I canceled out of the code editor. Hins, þegar ég reyndi að birta mynda Skömmu síðar, it required that I publish as an "Administrator-approved form template (háþróaður)". 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.

Í dag, I did it again. Í þetta sinn, Ég hafði aðeins meiri tíma á höndum mínum og fann að þú getur auðveldlega losa þetta.

Fara til:

Tools -> Form Valkostir -> Forritun: "Remove Code"

Það skiptir ekki miklu auðveldara en að.

</enda>

Technorati Tags: ,