Kuv kom kuv kuj tsis yog thawj tug neeg tuaj txog qhov nov. Txawm li cas los, Kuv tsis pom leej twg luam tawm tsab ib ua kom yuam kev li no vim kuv pib hmoog kaw rau lub zej zog lub Xya Hli Ntuj tas los no. Li ntawd, Kuv xav tias kuv yuav tswg nws no lub taub debug txoj kev sai thiab yooj yim.
Kuv tabtom ua hauj lwm rau hauv ib qho kev tshwm sim receiver uas pib Meskas no yuam kev hauv lub 12 nas muv:
Yuam kev chaw thau khoom thiab khiav cov kev tshwm sim receiver Conchango.xyzzyEventReceiver nyob xyzzy, Version = 1.0.0.0, Culture = nruab nrab, PublicKeyToken = blahbalhbalh. Xav paub ntxiv hauv qab no yog. : Kwv siv tsis tau teem rau kev lom los ntawm ib tug kwv.
Kuv tsis paub qhov twg kuv twb nkag tau no tiam sis vim kuv tau ua ntau yam hauv ib qhov ntawm kuv qhov chaws/deploy/kuaj mus.
Kuv sim cov tshuaj no tau txais kuv cov pdb nyob rau ntawd nrog hopes ntawd SharePoint 12 nas muv yuav qhia rau cov pawg ib txoj lw, tab sis tsis muaj hmoo. Kuv tsis paub tias yog tau thiab yog hais tias ib tug neeg twg, thov qhia rau kuv paub 🙂
Kuv paub tias nws puas yuav tau mus sau ntawv rau koj tus kheej mus sib cav ntawm 12 nas muv. Frankly, Kuv xav tej yam tsawg me ntsis scary thiab kom muaj kev cuam sai.
Nws pom kuv tias kuv kawg tau ib cov lus sau ib txoj lw los tuag thiab rov ntuav generic ntxiv li no:
ua tiag { UpdateEditionDate(khoom); } ntes (Kos e) { pov tshiab Kos("Dispatcher, UpdateEditionDate(): Kos: [" + e.ToString() + "]."); }
Qhov no kuj nyob hauv lub 12 hive thusly:
Yuam kev chaw thau khoom thiab khiav cov kev tshwm sim receiver Conchango.xyzzyEventReceiver nyob xyzzy, Version = 1.0.0.0, Culture = nruab nrab, PublicKeyToken = blahblahblah. Xav paub ntxiv hauv qab no yog. : Dispatcher, UpdateEditionDate(): Kos: [System.NullReferenceException: Kwv siv tsis tau teem rau kev lom los ntawm ib tug kwv. tom Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties zog) tom Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties zog, Txoj hlua eventDescription)].
Uas tau muab kuv nthuav dav kuv tau teev cia tias xyov qhov teeb meem thiab kuv cia siab tias yuav siv heev mus rau pem hauv ntej.
</kawg>
Tsis tau zoo, teeb lub tsev qiv ntawv logging li Enterprise qiv los sis log4net thiab koj lub neej yuav yooj.