简体   繁体   中英

How to fill record in table when the VS debugger stops

I have one ASP.NET MVC -5 application and in the backend I have one table where I keep track of user session. Details like when they log in, sessionout time and timezone and all. But as I run the code in localhost. I log in the user and thus the entry gets stored in the sessions table. But when I stop the debugger I want to fill the sessiontime out column. So basically when the VS debugger stops I want to put that time as sessiontime out in the table that I have. How to achieve this? I don't know where to start and what code to put here. How to capture the time when debugger stops and store that in the table. Please guide me.

The problem is the "stop debugging" function will halt the application entirely - so no more code within that application will run.

I'm not completely sure about this but very curious if anyone can update my answer and let us know if any other solution is available

According to [MSDN]:

Stop Debugging terminates the process you are debugging if the program was launched from Visual Studio.

However you may be able to achieve what you want with a visual studio add-in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM