How to Debug a Windows Vista Sidebar Gadget With Visual Studio Kaip Debug "Windows Vista Sidebar Gadget with Visual Studio
One of the ancillary benefits of our Vienas iš papildomos naudos iš mūsų Vista Gadget breaking Vista "įtaisų Breaking and my email filling up with complaints was that I learned how to debug a Vista Gadget in Visual Studio, so I'm sharing the wealth with everybody. ir mano pašto pildymo skundus buvo, kad aš sužinojau, kaip debug Vista "įtaisų Visual Studio, so I'm dalintis su visais turto.
For this exercise you'll need a copy of Visual Studio 2005 and a broken Vista Gadget, but you can probably adapt it to work with a different tool if you try. Už šį darbą reikės "Visual Studio 2005 ir skaldyti Vista" įtaisų kopija, bet galima turbūt ją pritaikyti darbui su įvairių įrankis, jei bandysite.
Critical Step: Enable Script Debugging Lemiamas žingsnis: Įjungti Script Debugging
Open up Internet Explorer's Options panel, find the Advanced tab and uncheck the boxes for “Disable script debugging”. Atidarykite Internet Explorer parinkčių langą rasti Advanced tab ir nuimti varnelę dėžės "Išjungti derinti scenarijaus".

After you are done debugging you'll probably want to turn this off, as it can get quite annoying while browsing. Po to, kai yra padaryta klaidų taisymas Jūs tikriausiai norėsite išjungti šią funkciją, nes ji gali gauti gana erzinančių naršydami.
Open Your Gadget Code Atidaryti Jūsų mini programos kodą
After installing your gadget, Windows will unpack and copy the files to a folder in your user profile. Įdiegę savo mini programą, Windows išpakuoti ir nukopijuoti failus į savo vartotojo profilį kataloge. We'll need to find this folder and open the javascript file that makes up the logic for your gadget. Mes turime rasti šį katalogą ir atidarykite failą JavaScript, kad sudaro savo mini logika.
Just paste the following into the Explorer address bar: Paprasčiausiai perkelkite į šiuos dalykus Explorer adreso juostą:
%LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets % LocalAppData% \ Microsoft \ Windows Sidebar \ gadgets

You'll see a list of directories for all the gadgets installed into your profile. Pamatysite katalogų sąrašą visų dalykėlių įdiegta į jūsų profilį. Open up the main javascript file in Visual Studio. Atverti pagrindinis failą JavaScript, Visual Studio.
Attach to Sidebar Process Pridėti prie šoninės procesas
Next we'll need to attach to the specific sidebar process for your gadget. Toliau mums reikės pridėti prie konkrečios Sidebar procesą savo mini programą. (Make sure your gadget is running before you do this step) (Įsitikinkite, kad jūsų įtaisą eksploatuoti, prieš tai žingsnis)
Go to Tools \ Attach to Process or hit Ctrl+Alt+P to bring up the dialog. Eikite į Tools \ Pridėti apdoroti arba paspauskite Ctrl + Alt + P išugdyti dialogo.

Now you should look for a process named “sidebar.exe” with the title set to the name of your gadget, and then click the Attach button. Dabar reikia ieškoti procesas vadinamas "sidebar.exe", kurių pavadinime nurodyta, kad jūsų mini programos pavadinimą, tada spustelėkite Pridėti mygtuką.

For a close-up view, you can see that the gadget is running under a separate process from the main sidebar, but the title is set to “How-To Geek”. For close-up view, galite įsitikinti, kad įtaisas veikia pagal atskirą procesą nuo pagrindinės Sidebar, bet pavadinimas yra nustatytas į "How-To Geek". 
Now comes the critical step… click to set a breakpoint just to the left of the white area… Dabar ateina kritinis žingsnis ... Spustelėkite norėdami nustatyti atskaitos tašką, tik ant balto ploto ...

If all goes well, you will immediately be taken to a new file named something like x-gadget:///main.js and your debugging tools will become active as soon as the breakpoint is hit. Jei viskas vyks gerai, tuoj pat bus atsižvelgta į naują failą pavadinimu kažką panašaus į x-gadget: / / / main.js ir Jūsų testavimo priemonės taps aktyvūs iškart, kaip atskaitos tašką, yra hitu.

Note that you can't modify this file, but you can use the Immediate Window to test out any code in real-time. Atkreipkite dėmesį, kad jūs negalite pakeisti šį failą, bet galite naudoti Immediate Window išbandyti bet realaus laiko kodu.
Important Notes Svarbios pastabos
- When debugging a gadget that polls every so often, it would be wise to set the interval really low so that you don't have to wait very long for it to trigger. Kai derinimo įtaisas, apklausos kas taip dažnai, kad būtų protinga nustatyti intervale tikrai mažas, kad jums nereikia laukti labai ilgai, kad ji galėtų sukelti.
- You can make changes in the original source file, but you will have to close/reopen the gadget and then re-attach to it. Jūs galite atlikti pakeitimus pradinio šaltinio failo, bet jums teks uždaryti / vėl mini programą ir vėl pridėti prie jos.
- If you get an error about no symbols being loaded, you didn't follow the first step to enable script debugging. Jei gaunate ne apie simbolius klaidos pakraunant, jūs ne po pirmą žingsnį, kad būtų galima derinti scenarijaus.
- You'll have to manually enter the names of variables to watch in the Watch box, but you can step through the gadget just like a real debugger should. Jums reikės įvesti rankiniu būdu, kintamųjų vardai laikrodis Žiūrėti langelį, bet galite pereiti mini kaip nekilnojamojo Debugger turėtų.
Happy debugging! Happy debugging!

Daily Email Updates Dienos paštas Atnaujinimai
You can get our how-to articles in your inbox each day for free. Galite gauti mūsų kaip prie straipsnių į Jūsų pašto dėžutę kasdien nemokamai. Just enter your name and email below: Tiesiog įveskite vardą ir elektroninio pašto adresą žemiau:



[quote]If you get an error about no symbols being loaded, you didn't follow the first step to enable script debugging.[/quote] [quote] Jei jums ne apie simbolius klaida pakraunant, jūs ne po pirmą žingsnį, kad būtų galima derinti scenarijaus. [/ quote]
Or you didn't completely restart sidebar.exe. Ar jūs ne visiškai naujo sidebar.exe. Running VistaSP2, IE8, VS2008. Veikia VistaSP2, IE8, VS2008. Restart of sidebar.exe was required to reload the debugging settings. Perkrauti sidebar.exe buvo reikalaujama Perkrauti Derinimo parametrai.