Last post May 03, 2012 01:54 PM by dkirk
Apr 25, 2012 08:35 PM|Mahesha999|LINK
Hi there I am using CassiniDev server (one which is used by VS2010 as a local ASP.NET development server ).
I have a class MyCassiniDevUtil which has following method:
public CassiniDevServer launchWebsite(string path, string navigate, int _portNo)
CassiniDevServer _server = new CassiniDevServer(); ///server
_server.StartServer(path, _portNo, "/", "localhost");
portNo = _portNo;
System.Diagnostics.Process.Start("http://localhost:" + portNo +
"/" + navigate);
But because I am not setting the TimeOut option of the server, after some time when I refresh the webpage. the browser says Cannot connect. How can I set the TimeOut option of the CassiniDev server?
May 01, 2012 09:30 PM|FightAsABull|LINK
Hi, hope this helps:
May 02, 2012 10:09 AM|Ruchira|LINK
I did some research on this. To be honest, I haven't use this. But try by playing a bit with the StartServer method. There may be an overloaded version of that method which take TimeOut as a parameter. Not sure whether this will help or not, but see the
second answer of the following StackOverFlow thread
Please 'Mark as Answer' if this post helps you
May 03, 2012 01:54 PM|dkirk|LINK
I am hosting the cassinidev server from within a winform app and ran into the same problem earlier. Instead of creating the CassiniDevServer object as you are in your example, use the Server object as shown below, it is overloaded and in the example below
86400000 is the timeout. This is working fine for me.
private readonly Server _server;
_server = new Server(81, "/", Path.Combine(Environment.CurrentDirectory, "WebContent"), IPAddress.Parse("18.104.22.168"), "localhost", 86400000);
and then to shutdown the sever use: