UpgradetoMicrosoftEdgetotakeadvantageofthelatestfeatures,securityupdates,andtechnicalsupport.
We'reexcitedtoannouncetheavailabilityofVisualStudio2022v17.13.Thisupdatefocusesstabilityandsecurity,alongwithcontinuousimprovementsall-around.
Allthenewfeaturesinthelatestpreviewrelease.
SpecifythedefaultencodingforsavingfilesinVisualStudio.
Developersworkingincross-platformenvironmentsoftenneedfilestobesavedwithspecificfileencodings.Changingtheseencodingscanleadtovariousissues.
VisualStudionowallowsyoutosetthedefaultfileencodingforsavingfiles.Thisfeatureensuresthatyourpreferredencodingisusedwheneverpossible.
Tosetthedefaultencoding,navigatetoTools→Options→Environment→Documents.There,youwillfindanoptiontitledSavefileswiththefollowingencoding.Ifthisoptionisunchecked,VisualStudiowillmanagefileencodingusingitsdefaultbehavior.Ifchecked,VisualStudiowillusetheencodingspecifiedintheadjacentcomboboxwheneverafileissaved.
IfVisualStudiocannotsavewiththespecifiedencoding(e.g.,requestingASCIIencodingforafilecontainingUnicodecharacters),itwilldisplayadialoginformingyouoftheissue.
Thehorizontalscrollbarintheeditorcannowmoveitselftoalwaysbeavailable,evenwhenspaceistight.
TheeditortrayinVisualStudioisausefulplaceforagreatdealofinformation.Youcancontrolyourzoom,checkthehealthofyourdocument,seewhatlineyou'reonandabunchofadditionalinformation.
Unfortunately,sometimesallofthatinformationcancrowdoutthehorizontalscrollbar,makingitdifficulttoscrollaroundyourwindow.Thisisparticularlytrueinaside-by-sideviewwherethesystemtrayisn'tverywide.
Withthislatestupdate,thesestrugglesareinthepast.Ifthescrollbardropsbelowausablewidth,itwillpopitselfupabovethesystemtrayandmakesureit'salwaysavailable.Bydefault,it'llpopbackintotheeditortrayassoonasthere'senoughroomforitagain.
Whilewethinkthisbehaviorwillbeidealformostusers,ifyou'rehavingproblemswithit,youcancontrolthebehaviorinTools→Options.TheoptionlivesunderTextEditor→AdvancedandsaysEditorhorizontalscrollbarlocation.Thiswillallowyoutoswitchifyouwantthescrollbartoadjustitspositionaccordingtotheavailablespace,stayintheeditortrayoralwaysappearabovetheeditortray.
Youcannowspecifywhetherlinesthatwrapintheeditorshouldbeindented.
Younowhavetheabilitytocontrolwhetherwrappedlinesareindentedornot.
Foruserswhowanttochangethisoption,itcanbefoundinTools→Options→TextEditor→General.TheoptioniscalledAutomaticallyindentwhenwordwrapisenabledandisenabledbydefault.Ifyoupreferyourwrappedlinesnottobeindented,youcanuncheckthisoption.
InCodeSearch,youcannoweasilyjumpbetweenyourrecentfiles.
We'remakingiteveneasiertonavigatearoundyourcodebase.
Now,whenyouopenCodeSearchwithoutaquery,you'llseealistofyourrecentlynavigatedfiles.TheseincludethefilesyouopenedthroughCodeSearch,butalsoanyotherfilesyouopenedinthesolution.Thismakesiteasytojumpbacktoafileyouwererecentlyworkingonwithouthavingtorememberortypethefilename.
VisualStudionowsupportsadvancedlineandcolumnnavigationinCodeSearch.
InCodeSearch,we'vesignificantlyenhancedlinenavigationcapabilities.Thefollowingformatsarenowsupported:
Theseimprovementsmakeiteasiertoquicklylocateandeditcode,enhancingyourproductivityandstreamliningyourworkflow.
InFeatureSearch,youcannowAskCopilottogetdetailedresponsesforyourqueries.
Everfindyourselfneedingtofindaspecificmenuitem,command,oroptioninVisualStudio,butyoudon'tknowitsnameorlocationWouldyoubenefitfrommoredetailsonhowtouseitproperly
NowinFeatureSearch,youcansendyourquerytoGitHubCopilotChattogetadetailedresponse.Ifyou'reunsureofthespecificterminologyforafeature,GitHubCopilotChatcaninterpretthesemanticmeaningofyourquery,consideryourVisualStudioversion,andprovideananswerwithouthavingtoleavetheIDE.
Forexample,searchingfor'prettifyfile'inFeatureSearchtodaywon'tsurfacethecorrectsetting'formatdocument'.ButGitHubCopilotChatcanidentifyandexplaintherelevantitemsinVisualStudio.
IfyourGitHubCopilotsubscriptionissetupinVisualStudio,youcansimplystarttypingyoursearchintoFeatureSearchandthenclicktheAskCopilotbuttontosendittochat.
Important
NewkeyboardshortcutsforthreadsinGitHubCopilotChat.
ThisupdateregistersnewCommandsforGitHubCopilotandbindsthemtokeyboardshortcutsintheChatwindow:
Next/Previousthreadwillcyclearoundwhenthefirst/lastitemarepassed.
BecausetheseareregisteredasVScommands,theycanbecustomizedbyusersintheKeybindingdialog.
Note:TheseshortcutswillonlyworkifyouractivefocusisintheGitHubCopilotChatpane.Ifyou'reworkingelsewhere,theseshortcutsmighthavedifferentfunctions.
Enhancedslashcommandexperiencebyexpandingintonaturallanguage.
Userscannowenjoyanenhancedslashcommandexperience-slashcommandsnowexpandoutintotheirnaturallanguagecounterpartsastheusertypes,includingpullinginanyactivecontextthey'lluseanddisplayingthatintheuser'spromptbeforetheysendit.
Thisprovidesuserswith
Aftertheslashcommandexpands:
Enhancededitableexpressionwithsyntaxhighlighting.
WritingLINQexpressionscangettricky,especiallyastheygrowcomplex.VisualStudio2022nowintroducessyntaxhighlightingintheIEnumerableVisualizerEditableExpression.
Syntaxhighlightingappliesdifferentcolorstospecificpartsofyourqueries,suchasclasses,enums,delegates,structures,andkeywords.ThismakesitsimpletospotvariouscomponentsinyourLINQexpressionsandseethelogicalflowataglance,leadingtoclearer,moremaintainablecode.
VisualStudioallowsyoutocustomizethecolorschemetosuityourpreferences.Topersonalizeyourcolors:
Profiler'sinstrumentationtoolnowsupportstargetedinstrumentationfornativecode.
TheVisualStudioProfiler'sinstrumentationtoolofferstargetedinstrumentationfornativecode,allowingyoutoselectspecificclassesandfunctionsfordetailedanalysis.
Thisfeatureenhancesperformancemonitoringandhelpspinpointissuesmoreefficiently,streamliningyourdebuggingprocess.
Thisprecisionallowsfordeeperinsightsintoperformancebottlenecksandacceleratesyourprofilingefforts.
EnhancethedebuggingprocesswithAIthreadsummariesinParallelStacks.
WithGitHubCopilot'sAuto-SummarizeinParallelStacks,youwillgetclearthreaddescriptionsataglance,makingitsimplertotraceissuesandunderstandthreadbehaviorsincomplexprograms.
IfyouuseGitHubCopilotinVisualStudio,you'llnoticeanewAI-generatedsummaryrowatthetopofeachthreadwhenyoulaunchaParallelStackswindow.
Thissummaryprovidesaquick,readableoverviewofthethread'scurrentactivity.
EnhancededitableexpressionwithGitHubCopilotInlineChatdirectlyintheIEnumerableVisualizer.
TheIEnumerableVisualizernowfeaturesinlinechatforitseditableexpression,enablinguserstoleverageAIdirectlywithintheIEnumerableVisualizertocraftcomplexLINQqueriesfortheeditableexpression.
Tobringuptheinlinechat,simplyclicktheGitHubCopilotsparklebuttonlocatedinthebottom-rightcorneroftheeditableexpressiontextbox.Thiswillopenatextboxabovetheoriginaleditableexpression,withapromptthatsaysDescribehowyouwanttorefineyourcurrentexpression.Enteryourrequestinnaturallanguage,andonceyou'reready,clicktheSubmitbutton.
GitHubCopilotwillgenerateaLINQquerybasedonyourinputandautomaticallyexecuteitbydefault.Toconfirmthatthequeryhasbeensuccessfullygeneratedandapplied,lookforthegreencheckmark,whichindicatesthattheLINQquerygeneratedbyGitHubCopilothasbeenfullyexecutedandapplied.
ThefeaturealsoincludesaContinueinChatbuttonafteratleastoneLINQqueryhasbeengeneratedbyGitHubCopilot,convenientlylocatedatthetop-rightcornerofthetextbox.
ClickingthisbuttonopensadedicatedGitHubCopilotChatwindowwhereyoucanrefineyourquery,askfollow-upquestions,orexplorealternativeapproachesinmoredetail.ThisintegrationensuresyoumaintaincontrolandflexibilitywhileleveragingthefullcapabilitiesofGitHubCopilot.
Whenyou'rereadytoreturntothevisualizer,simplyclicktheShowinVisualizerbutton.Thisallowsyoutoseamlesslytransitionbacktothevisualizerenvironment,whereyoucanvieworapplythechangesgeneratedduringyourchatsession.
ThisfeatureprovidesafluidworkflowbetweenthevisualizerandGitHubCopilotchat.Thevisualizerinlinechatisoptimizedforquickeditsandsmalladjustments,whiletheGitHubCopilotchatexcelsathandlingmoredetailedrefinementsanditerativeimprovements,bothofwhichaimtomakegeneratingLINQqueriesforeditableexpressioneasierandmoreefficient.
VSProfilerunifiesasyncstacksforstreamline.NETprofiling.
TheVisualStudioProfilernowenhancesdebuggingfor.NETapplicationsbydisplayingstitchedasyncstacksinboththesummarydetail'scalltreeview.
Thisfeatureprovidesaclearer,morecohesiveviewofasynchronousoperations,allowingdeveloperstotracethefullexecutionflow,includingasynchronousmethodcalls,allwithinasingle,unifiedstacktrace.
Byeliminatingtheneedtomanuallypiecetogetherseparateasynccallpaths,thisimprovementcanhelpyouquicklyidentifyperformancebottlenecksandtroubleshootissuesmoreefficiently.
VSProfilerenablesmultiprocessCPUanalysiswithcolor-codedgraphsandfiltering.
TheVisualStudioprofiler'sCPUUsagetoolnowsupportsmultiprocessanalysis,displayingperformancegraphswithdistinctcolorcodingforeachprocessinswimlane.
Thegraphswillbedisplayedasstackedareacharts.Youwillalsohavetheoptiontofilterprocessesusingadropdownontopleft,enablingfocusedanalysis.
ThisimprovementenablesyoutoeasilydistinguishandanalyzeCPUutilizationacrossprocesseswithinasinglesession.Byprovidingclearerinsightsintoresourceconsumption,thisenhancesprofilingefficiencyandstreamlinesperformanceoptimizationformultiprocessapplications.
ReviewpullrequestsinVisualStudiobyaddingnewcommentstothepullrequestfilesonthechecked-outbranch.
Withthelatestupdate,youcannowaddnewcommentstopullrequestfilesonthechecked-outbranch.ThiswasatoprequestforthepullrequestexperienceandisthelatestinaseriesofimprovementstothepullrequestexperienceinVisualStudio.
EnablethefeatureflagsPullRequestCommentsandPullRequestAddComment,checkoutanybranchwithanactivepullrequest,andclickonShowcommentsinfilesintheInfoBar.Thiswillactivatethepullrequestcommentsexperienceintheeditor.
Toaddanewcommenttoafile,clickontheAddCommenticoninthemargin,orright-clickthelineyou'dliketoaddacommentonandchooseGit→AddCommentfromthecontextmenu.
Note:Theiconwillonlyshowinfilesthatarepartofthepullrequest.ForGitHubpullrequests,you'llonlybeabletocommentonlinessurroundingandincludingthelinesthathavebeenchanged.
Note
ThisfeaturemustbeenabledunderTools→ManagePreviewFeatures
GetGitHubCopilot-poweredsuggestionsforyourcodechangestohelpyoucatchpotentialissuesearlyandimproveyourcodequality.
Now,youcangetaGitHubCopilotcodereviewonyourlocalchangesbeforeyouevencommit!WithyourGitHubCopilotsubscriptionenabledinVisualStudioandthefollowingfeatureflagsenabled,youcanseethenewsparklecommentbuttonintheGitChangeswindow.Whenclicked,GitHubCopilotwillexamineyoursetsofchangesandproposesomesuggestionsinlineinyoureditor.
Themodelcanpointoutcriticalissuessuchaspotentialperformanceandsecurityproblemsthat,whencaughtearly,helpreduceyourriskofpushingissuesintoyourremotecodebase.
Ensureyouhavebothofthefollowingfeatureflagsenabled:
NavigateandpushGittagsseamlesslyfromVisualStudio.
You'llbeabletoviewGittagsforarepositorydirectlyintheGitRepositorywindow,youcannavigatetothecommitthetagcorrespondstoandbringupacontextmenuwithactionsyoucantakeonthetag.YoucancontinuetostaywithinthecontextoftheIDEtoperformactionsongittags.
Changingthemeswillnowrememberyourfontandfontsizepreferences.
Weunderstandthatthefontsdevelopersselectwhencodingisapersonalchoice,influencedbypreferencesforreadability,accessibility,oraesthetics.VisualStudiothemesprimarilyfocusonpresentationcolorsandareindependentofyourpreferredfonts.
Withthisupdate,we'veintroducedfunctionalitytoretainyourfontfaceandsizechoiceswhenswitchingthemes.YoucannowsetyourfontpreferencesonceandswitchthemesinVisualStudiowithoutneedingtoreconfigureyourfontsettingseverytime.Notethatthecolorsofyourfontsremainlinkedtothetheme,asthatisthepurposeofthemes,butyourfontselectionswillbepreserved.
Thisfeaturewillbeenabledbydefaultforallusers.Ifyoupreferthepreviousbehavior,gotoTools>ManagePreviewFeaturesandfindtheoptionSeparatefontsettingsfromcolorthemeselection.Ifthisoptionischecked,yourfontpreferenceswillbemaintainedregardlessofthemechanges.Unchecktheboxtoreinstatethepreviousbehaviorwhichtiesfontchoicestotheme.
AddGitHubaccountsfromthefirstlaunchwizardortheVisualStudioshell.
DoyouneedtoworkwithGitHubresourcesAddingyourGitHubaccountisnoweasierthanever!
YouarenowabletosigninwithyourGitHubaccountduringthefirstlaunchconfigurationdialog:
Ifyoudecidetoskipthefirstlaunchaccountsetting,youcanalsosigninstraightfromtheVSshellwithouttheneedtofirstaddaMicrosoftaccount.
Pleasenotethatyouwon'tbeabletosyncyoursettingsuntilyouaddaMicrosoft(workorschoolorpersonal)accounttoVisualStudio.
YoucannowaddmultipleGitHubaccountsandsetanactiveaccounttodriveGitHubfeatureslikeGitHubCopilotandVersionControl.
DoyouneedtousedifferentGitHubaccountsforyourdevelopmentscenariosVisualStudionowallowsyoutohavemultipleGitHubaccountsatthesametime!
Addingmultipleaccountsiseasy!Simplyopentheprofilecard,clickonAddanotheraccount,signintoyourGitHubaccountandrepeatasneeded!
YoucanalsoaddyouraccountsfromtheAccountSettingsdialogunderFile→AccountSettings...
IfyouaddmultipleGitHubaccounts,VisualStudiowilldefaulttotheonemarkedasactiveforGitHubawarefeaturessuchasversioncontrolandGitHubCopilot.
Toswitchtheactiveaccount,simplyaccesstheaccountoptionsandclickontheSetasactiveaccountbutton.
GitHubCopilotactivatesautomaticallywhentheactiveGitHubaccountissubscribedtoeitherGitHubCopilotforIndividualsorGitHubCopilotforBusiness.
WhenworkingonGitHubpullrequestsorissues,you'llgetaprompttosetyourGitHubaccount.We'llrememberyourpreferenceswheneveryouworkonaparticularrepository,sowhenyouchangerepositories,youwon'thavetoworryaboutswitchingyouraccountsforyourregularGitoperationslikepush,pull,andfetch.You'llalsogetpromptedtoupdateyouractiveaccountifthere'severamismatchtoavoidusingthewrongaccount.
AddinganewmarkdownfilejustgoteasierwiththenewtemplateavailableintheAddNewItemdialog.
Whenyouaddanewitemtoyourproject,youcannowselecttheMarkdownfiletemplatetocreateanewmarkdownfile.Thistemplateprovidesastartingpointforyourmarkdowncontent.
Toaddanewmarkdownfiletoyourproject,followthesesteps:
AzureFunctionscannowuse.NETAspiretointegrateserverlesstechnologyinto.NETAspire.
WiththisreleaseofVisualStudio,AzureFunctionsdeveloperscannowleverage.NETAspireorchestrationwhencreatinganewAzureFunctionsproject.Byselectingthisoption,anAppHostandaServiceDefaultsprojectwillbeincludedinyoursolutionwhentheFunctionsprojectiscreated.
IfyouhaveanexistingAzureFunctionsproject,suchasoneintegratedwithanASP.NETCoreBlazorfront-endwebapp,youcanadd.NETAspiresupporttoit,justasyoucouldwithASP.NETCoreappspriortothisrelease.
Additionally,runningordebugginganAzureFunctionsprojectwith.NETAspiresupportwilllaunchthe.NETAspiredashboardinyourbrowser.ThisallowsyoutomonitortheexecutionofyourAzureFunctionsinreal-time.Youcanobservehowthe.NETAspireorchestratormanagestheexecutionofyourAzureFunctionsandevenpauseandresumetheirexecutionfromthedashboard.
WeareexcitedaboutthisintegrationandlookforwardtoseeinghowyouwillincorporateAzureFunctionsintoyour.NETAspireprojects.
Enabledepends_onsupportwithDependencyAwareStartlaunchconfigoption.
We'veintroducedanewlaunchconfigurationoptioncalledDependencyAwareStartthat,whensettoTrue,changeshowDockerComposeprojectsarelaunchedandenablestheuseofdepends_oninyourComposeconfiguration.
Thisfeatureensuresthatspecifiedcontainersarestartedinthecorrectorder,adheringtothedependencyrequirementsdefinedinyourDockerComposefile.Additionally,itenhancestherobustnessandreliabilityofmulti-containerapplicationsbymanagingdependenciesmoreeffectively.
Thescalepropertyincomposeisnowhonored.
YoucannowaddscaletoyourComposeserviceconfigurationtodebugwithaspecificnumberofreplicasrunning.Forexample,thebelowconfigurationwillruntwoinstancesofthewebapiservicewhenlaunched.
Thisenhancementallowsformoreeffectiveloadtestinganddebuggingofyourapplicationsbysimulatingaproduction-likeenvironment.ItalsostreamlinesyourworkflowbymakingiteasiertomanagemultipleinstancesdirectlyfromyourComposefile.
YoucannowextractHTMLtoaRazorcomponentinVisualStudioviacodeaction.
Haveyoueverfoundyourselfaddingtoomuchcodetoa.razorfileandwantedaneasywaytomoveittoitsownreusablecomponentWhenworkingwithHTMLinaRazorfile,youcannowuseCTRL+.orright-clickandselectQuickActionsandRefactoringstoautomaticallyextractyourselectedHTMLmarkuptoanewRazorcomponentinVisualStudio!
Inthisfirstiteration,ExtractelementtonewcomponentisonlysupportedwithHTMLmarkupselections.
YoucannowdisabletheformatonpastefeatureforRazorfilesintheVSSettings.
DoyoufindtheFormatonpastefeatureinRazorfilestobemoreofahindrancethanahelpYoucannowdisableautomaticformattingwhenpastingcodeinRazorfiles.
DisablethesettingbynavigatingtoTools→Options→TextEditor→Razor(ASP.NETCore)→AdvancedanduncheckingFormatonpaste.
YoucannowusetheSDK-styleprojectfileformatinyourSQLServerDataToolsprojectswiththeSQLdebuggerandschemacompare.
ThisupdateaddsschemacompareandSQLdebuggingtoSDK-styleSQLServerDataTools(preview)inVisualStudio17.13.SDK-styleSSDTSQLprojectsarebasedontheMicrosoft.Build.SqlSDK,whichbringscross-platformsupportandimprovedCI/CDcapabilitiestoSQLServerDataTools(SSDT)projects.
Schemacomparein17.13preview2islimitedtodatabaseand.dacpaccomparisons,SQLprojectcomparisonisnotyetavailable.TheSQLdebuggerin17.13preview2islimitedtodebuggingfromtheSolutionExplorer.TabledesignerandotherscriptoptionshavebeenimprovedintheSQLServerObjectExplorer.
MakesuretoinstallthelatestSSDTpreviewcomponentintheVisualStudioinstallertousetheSDK-styleSQLprojectsinyoursolution.