1

very strange that on checkout visual studio kills sessions, so when i checkout any file i have to log back in to my asp.net application again and again, its annoying :(

I have noticed above behaviour in visual studio 2010 and 2012, using it with VSS or Team Foundation Server. MSDN documentation Checkout does not have any details about such behaviour.

Wondering is it me ? or my code ? or its something Visual studio does?

anyone else is facing same problem ?

Web App Property

chintan123
  • 348
  • 3
  • 10
  • Was about to finish writing an answer to your question and found a duplicate one: http://stackoverflow.com/questions/3965346/app-offline-htm-created-deleted-whenever-i-check-out-a-file-in-tfs – Artyom Neustroev Jul 03 '14 at 06:52

2 Answers2

3

If Visual Studio detects a change in certain files, it will restart the web application if it's hosted on the internal development server (perhaps even IIS Express), which will in turn invalidate your user sessions. I'm not sure it works for every type of file, but I know it happens for me with the cshtml views since Visual Studio 2012. Obviously, like in IIS hosted web apps, a change to the web.config will cause a restart also.

Your best bet would be to externally host your site, meaning host it in IIS, not in the development server (Cassini). You can configure this in your Web Application's project properties.

Rudi Visser
  • 21,350
  • 5
  • 71
  • 97
  • FYI i am checking out .aspx file which check outs .vb and .vb.designer file all together. My understanding is that while checking out visual studio just removes read-only flag from selected files. – chintan123 Jan 03 '13 at 10:21
  • @chintan123 Yes, which is registered as a change to the file. Try using IIS and let me know how you get on. – Rudi Visser Jan 03 '13 at 10:22
  • i have updated post with screenshot. Can you try to reproduce same behaviour in local dev machine and confirm ? – chintan123 Jan 03 '13 at 10:33
  • @chintan123 That is the setup I use now, if I recompile the application it will restart obviously, however upon checkout, it will only do this when I am using the `Visual Studio Development Server`. – Rudi Visser Jan 03 '13 at 10:37
  • Ok then let me try creating new project in TFS and see same behaviour exist. – chintan123 Jan 03 '13 at 11:17
  • I just create new Web Form Application and Added it to TFS, Tried to run it using Virtual directory as well using IIS Express. but not change in result. it still kills session. – chintan123 Jan 03 '13 at 14:16
1

There IS a workaround. I found it out by accident:

App_offline.htm created/deleted whenever I check out a file in TFS

The title is misleading; nevertheless it's all about the checkout process and the annoying session drop.

It does work for VS 2013 and VS 2015.

The answer above is so much difficult to access that it's worth creating an answer here. Thanks to the moderators for their understanding.

Community
  • 1
  • 1
roland
  • 7,695
  • 6
  • 46
  • 61