Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7856623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:45:53+00:00 2026-06-02T20:45:53+00:00

I am using the CassiniDevServer in my project. I created a object of the

  • 0

I am using the CassiniDevServer in my project. I created a object of the CassiniDevServer class and then call its start() method passing appropriate argument.

The server hosts and renders the webpages correctly in the browser. But after some time, when refreshed, browser says

Cannot connect to localhost:portno

It seems like server gets stopped after some time. Why is it so? How can I avoid this? Is it getting garbage collected?

I have a class MyCassiniDevUtil which has following method:

public CassiniDevServer launchWebsite(string path, string navigate, int _portNo)
  {
    CassiniDevServer _server = new CassiniDevServer();  ///server

    cassiniServerList.Add(_server);
    _server.StartServer(path, _portNo, "/", "localhost");
    portNo = _portNo;

    System.Diagnostics.Process.Start("http://localhost:" + portNo + 
          "/" + navigate);
    return _server;           
  }

In the calling code I create an object of MycassiniDevUtil and then call this method. This method returns the reference to the currently created server instance. I assign this reference in the calling code class.

So actually I do have references to both classes, but still I feel it is getting garbage collected. Or if not I don’t understand why after few minutes when I refresh the browser it shows cannot connect to…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:45:55+00:00Added an answer on June 2, 2026 at 8:45 pm

    Instead of creating an object of CassiniDevServer class in CassiniDev; package, I created an object of Server class as follows (since it allows to specify the timeout property)

            System.Net.IPAddress ip = System.Net.IPAddress.Parse("127.0.0.1");
            Server _server1 = new Server(_portNo, "/", path, ip, "localhost", 1800000);
            _server1.Start();            
    

    _portNo is any port number – possibly in the range of unused port numbers. I generated one dynamically and randomaly as follows:

            Random rn = new Random();
            int _portNo = rn.Next(1500, 4000);
    

    path is a physical path to the website folder (the one which contains web.config,AppCode, AppData).

    1800000 are the milliseconds equivalent for 30 minutes.

    / is specified to get the website hosted at address http://localhost:<_portNo>/

    But can anyone clarify whats difference between CassiniDevServer and Server class in CassiniDev package.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database
Using SQL Server 2000 Table1 Id date --- ---------- 001 23/01/2012 002 25/01/2012 003
Using EF Code First I have an model object that has multiple properties that
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using SQL Server 2005 Leave Table ID StartDate EndDate 001 02/03/2010 02/03/2010 002 02/03/2010
using VB.Net2010 I need to call a C# DLL The problem I have is
Using JDeveloper , I started developing a set of web pages for a project
Using C#, I need a class called User that has a username, password, active
Using boost python I need create nested namespace. Assume I have following cpp class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.