I am trying to clear up the IISExpress Cache from the powershell. Using this code it complains about the list.
"C:\Program Files (x86)\IIS Express\appcmd.exe" list site /xml | appcmd delete site /in
How can I clear up the sites and the IIS Express cache?
At line:1 char:50 + "C:\Program Files (x86)\IIS Express\appcmd.exe" list site /xml | app ... + ~~~~ Unexpected token 'list' in expression or statement. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnexpectedToken
You can clear IIS cache by navigating to below folder on Window server and delete temporary files You can also Recyle the application pool. By opening IIS, then select "Application Pool" and then select the website for which you want to clear cache, then on right hand side pane, click "recycle".
Scroll to the bottom of the menu and click on “Settings.” Select “Privacy, search, and services.” It should be the second option below the search bar. Scroll down until you reach “Clear Browsing Data” and select “Choose what to clear.” A window will pop up that indicates the types of data saved by your browser.
Double-click Application Request Routing Cache. In the Actions pane, click Delete All Cached Objects. In the confirmation dialog box, click Yes. All cached contents have been deleted from all primary cache drive location (s). As noted above, this action can take a long time if there are many cached objects.
Open CMD prompt & Navigate to IIS express - by typing the following This will delete all the sites, enjoy! run this ./appcmd.exe list site /xml | ./appcmd delete site /in Check the Assembly.GetExecutingAssembly ().Location property (watch, immediatewindow) when you are debugging and you are stopped at some Breakpoint
Open CMD prompt
& Navigate to IIS express - by typing the following
cd "C:\Program Files (x86)\IIS Express\"
run this
appcmd.exe list site /xml | appcmd delete site /in
This will delete all the sites, enjoy!
Update for PowerShell Version
Thanks to @sibbij
cd "C:\Program Files (x86)\IIS Express\"
run this
./appcmd.exe list site /xml | ./appcmd delete site /in
%temp%\Temporary ASP.NET Files\vs...\assembly....\YOUR.dll
%temp%\Temporary ASP.NET Files\
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With