Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx

上传人:b****6 文档编号:21818602 上传时间:2023-02-01 格式:DOCX 页数:12 大小:435.27KB
下载 相关 举报
Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx_第1页
第1页 / 共12页
Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx_第2页
第2页 / 共12页
Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx_第3页
第3页 / 共12页
Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx_第4页
第4页 / 共12页
Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx

《Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx》由会员分享,可在线阅读,更多相关《Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx(12页珍藏版)》请在冰豆网上搜索。

Diagnosing Issues in Production with IntelliTrace and Visual Studio 11Word格式.docx

Exercise1:

UsingIntelliTraceinProduction4

Exercise2:

DebuggingwithIntelliTraceFilesfromProduction10

Overview

IntelliTrace–firstreleasedinVisualStudio2010–changedthegamefordebuggingbyallowingdeveloperstostep“backintime”toseehowanapplicationgotintoitscurrentstate.Byexposingeventssuchasfileandregistryaccess,exceptions,andmethodcalls,anIntelliTracefilecanprovideadetailedviewintoapplicationbehavior.Inthislab,youwilllearnhowVisualStudio11willextendthecapabilitiesofIntelliTracebeyondthedevelopmentandtestingorganizationsbyprovidingITadministratorswiththeabilitytocaptureIntelliTracefilesrunningfromproductionservers.Thesefilescanthenbeanalyzedbydeveloperstohelpdiagnoseproductionissues.

Prerequisites

InordertocompletethislabyouwillneedtheVisualStudio11virtualmachineprovidedbyMicrosoft.Formoreinformationonacquiringandusingthisvirtualmachine,pleaseseethisblogpost.

AbouttheFabrikamFiberScenario

Thissetofhands-on-labsusesafictionalcompany,FabrikamFiber,asabackdroptothescenariosyouarelearningabout.FabrikamFiberprovidescabletelevisionandrelatedservicestotheUnitedStates.TheyaregrowingrapidlyandhaveembracedWindowsAzuretoscaletheircustomer-facingwebsitedirectlytoend-userstoallowthemtoself-serviceticketsandtracktechnicians.Theyalsouseanon-premisesASP.NETMVCapplicationfortheircustomerservicerepresentativestoadministercustomerorders.

Inthissetofhands-onlabs,youwilltakepartinanumberofscenariosthatinvolvethedevelopmentandtestingteamatFabrikamFiber.Theteam,whichconsistsof8-10people,hasdecidedtouseVisualStudioapplicationlifecyclemanagementtoolstomanagetheirsourcecode,runtheirbuilds,testtheirwebsites,andplanandtracktheproject.

Exercises

Thishands-onlabincludesthefollowingexercises:

1.UsingIntelliTraceinProduction

2.DebuggingwithIntelliTraceFilesfromProduction

Estimatedtimetocompletethislab:

60minutes.

UsingIntelliTraceinProduction

Inthisexercise,youwilllearnhowtodeployanduseIntelliTraceinProductiontocapturetraceinformationforanASP.NETapplication.

3.LoginasAdam.AlluserpasswordsareP2ssw0rd.

4.LaunchInternetExplorerandclickontheFFCustomerPortalbuttoninthefavoritesbartoloadthecustomerportalforFabrikamFiberSupport().

Figure1

FabrikamFibercustomerportal

5.SelectafewoftheserviceticketsfromtheMyTicketssectionofthepagetoviewtheirdetailsuntilyoucomeacrossonethatindicatesthatanerroroccurredretrievingdatafromtheserver.Thisinformationisultimatelypulledfromadatabase,buttherecouldbeanynumberofreasonsforthegeneralerrormessageitself.

Figure2

Errormessageshownwhenselectingserviceticket

6.CloseInternetExplorer.

7.Typically,thefirststepindeterminingtherootcauseofanerrorlikethiswouldbetochecklogsfordetailsandperhapsastacktrace.Ifthatdoesnotprovideenoughinformation,andtheerrorisnoteasilyreproducedinadevelopmentenvironment,thedevelopmentteammayenduptakingalongtimetodeterminetherootcauseandfixtheproblem.InstallingVisualStudioorotherdebuggingtoolsinaproductionenvironmentmaynotbeanoption.

8.Nowlet’slookathowtodeployanduseIntelliTraceinaproductionenvironmenttocollecthistoricaldebuggingdata.OpenaWindowsExplorerwindowandnavigatetotherootoftheC:

drive.Notethattherearetwofoldersherethatwerecreatedaheadoftimeforouruseinthislab,c:

\IntelliTraceiswherethestandaloneIntelliTracefilesareplacedandc:

\LogFileLocationiswheretheIntelliTracefileswillbewrittentolateroninthislab.

Figure3

LocationofIntelliTracefilesfolderandlogfilefolder

9.InanExplorerwindow,right-clickontheLogFileLocationfolderandselectPropertiestoopenthePropertieswindow.WeneedtomakesurethattheIISapplicationpoolhaspermissiontousetheLogFileLocationfolder.

10.SelecttheSecuritytabandthenscrolldowntheexistinglistofgroupsandusernamestofindFabrikamFiber.Extranet.Web.PermissionswereaddedaheadoftimeinthisVM,butinaproductionenvironment,youwouldneedtomakesuretoperformthisstepyourself.

Figure4

Settingsecuritytoenablelogfilestobewritten

11.PresstheEscapekeytoexitoutofthepropertieswindow.

12.IntelliTracecanbedeployedtoaproductionenvironmentsimplybyextractingthecontentsoftheIntelliTraceCollection.cabfilethatshipswithVisualStudio11.ThistaskhasalsobeenperformedaheadoftimeintheVMforyourconvenience,sothereisnoneedforyoutoperformthisstep.

Figure5

ExtractedcontentsofIntelliTraceCollection.cabfile

Note:

Forthepurposesofthislab,theproductionsystemisthesameasourdevelopmentsystem,butthatwillnotnormallybethecase.

13.OpenaPowerShellwindowandtypethefollowingcommandtoimporttheIntelliTracePowerShellmodule:

Import-Modulec:

\IntelliTrace\Microsoft.VisualStudio.IntelliTrace.PowerShell.dll

14.ToseethecommandsprovidedbyIntelliTrace,usingthefollowingPowerShellcommand:

Get-Command*IntelliTrace*

Figure6

Searchingforcommandsthatcontain“IntelliTrace”

CommandsareprovidedtostartandstopanIntelliTracecollection,aswellastotakecheckpointsduringcollection.

15.TogethelpforanyofthePowerShellIntelliTracecommands,typesomethinglikethefollowing:

Get-HelpStart-IntelliTraceCollection

Figure7

HelpscreenfortheStart-IntelliTraceCollectioncommand

TheREMARKSsectionfromthehelplistingdescribeshowyoucangetmoredetailedexamplesofcommandusage.

16.WearenowreadytostartIntelliTracecollection.TypethefollowingPowerShellcommandtostartcollectingdatafromtheFabrikamFiber.Extranet.WebIISapplicationpoolandstoretheresulting.iTracelogfilesinthefolderwepreviouslycreated.

Start-IntelliTraceCollection"

FabrikamFiber.Extranet.Web"

c:

\IntelliTrace\collection_plan.ASP.NET.trace.xmlc:

\LogFileLocation

IntheVisualStudio11DeveloperPreview,youcanhand-editthecollectionplanfileifyouwanttomakechanges.Agraphicaleditorisexpectedtobeprovidedinalaterrelease.

17.Whenaskedtoconfirm,type“Y”andthenpresstheEnterkeytocontinue.

Figure8

Confirmingtherequesttostartacollection

18.LaunchInternetExplorerandclickontheFFCustomerPortalbuttoninthefavoritesbartoload.

19.IntelliTraceisnowsetuptogatherthedebuggingdataspecifiedinthecollectionplanconfigurationfile.Selecttheserviceticketstoreproducetheerrorthatwesawbefore.Assoonasyouseetheerror,closeInternetExplorer.

Figure9

Reproducingtheerror

20.ReturntothePowerShellwindowandtypethefollowingcommandtogetthecurrentcollectionstatus.

Get-IntelliTraceCollectionStatus-ApplicationPool"

Figure10

Collectionstatus

21.TypethefollowingcommandtostopgatheringIntelliTracedatafortheFabrikamFiber.Extranet.Webapplicationpool.Confirmtheactionwhenprompted.

Stop-IntelliTraceCollection"

AsanalternativetostoppinganIntelliTracecollection,itisalsopossibletogetacopyofthecurrentlogbyusingtheCheckpoint-IntelliTraceCollectioncommand.Thisallowsyoutolookatthedatayouhavecapturedsofarwhilecontinuingtocollectadditionaldata.

22.Inareal-worldscenario,itisatthispointthattheIntelliTracefilewouldbesenttoadeveloperortesterforamoredetailedlook.

DebuggingwithIntelliTraceFilesfromProduction

Inthisexercise,youwillseehowwecanusetheIntelliTracefilethatwasgeneratedonaproductionservertoaidindebuggingtheerrorthatwesawinthepreviousexercise.

23.Returningtoourscenario,let’sassumethatwehavealreadytakenthisIntelliTracefileandtransferredittoadevelopmentmachinethathasVisualStudio11installed.Double-clickontheIntelliTracefiletoloaditinVisualStudio11.

Figure11

LoadingtheIntelliTracefile

24.IntheIntelliTracesummarywindow,scrolldowntotheExceptionDatasection.Hereyoucanseeagridshowingallexceptionsthatoccurred.Bydefault,theyaresortedbymostrecenteventtimetotheoldest.

Figure12

ExceptionDatasectionofIntelliTracesummary

25.SelectthelastSystem.NullReferenceExceptionfoundinthelist,thatisthetechnicallytheoldestorfirstonethatwasthrown,andthenselecttheStartDebuggingbuttontostartanIntelliTracedebuggingsession.

Figure13

Startdebuggingataspecificevent

26.AftertheIntelliTracedebuggingsessionstarts,youwillseethattheIntelliTracepaneisautomaticallyloadedandthelocationincodewheretheexceptionoccurredishighlighted.YounowhavefullaccesstothenormalsuiteofIntelliTracedebuggingfunctionality.

Figure14

Debuggingthethrownexception

27.IntheLocalswindow,notethattheServiceTicket.AssignedTopropertycurrentlyhasanullvalue.ThisexplainswhyreferencingserviceTicket.AssignedTo.FullNameincoderesultedinthenullreferenceexceptionthatwesaw.Atthispoint,wecouldfileabuginTeamFoundationServerandattachtheIntelliTracefiletohelpthedevelopmentteammaketheappropriatefix.

Figure15

Findingrootcauseforexception

Togi

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 工学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1