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 9284933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:01:34+00:00 2026-06-18T19:01:34+00:00

I have created a simple web application which runs locally and makes use of

  • 0

I have created a simple web application which runs locally and makes use of a simple web socket server which I implemented using Alchemy Web Sockets. Now I need to deploy this app to Windows Azure.

Currently the solution is made up of an MVC4 website and a console app for the web socket server. My question is how would I deploy my current solution to Windows Azure? Is it even possible to use Azure for the console app?

From what I’ve seen on the Azure website I can deploy the MVC4 website as an Azure website and the console app (server) on either a virtual machine or a cloud service. It seems to me that a cloud service makes more sense (since the infrastructure is managed by Microsoft and I am not interested in that), but I am completely new to these technologies so I am not sure which is the best approach/if it is even possible.

EDIT:

I have implemented the web socket server console app as part of the web role as suggested by Sandrino. However, when loading the page which connects to the server I get the following error in the chrome debugger Unexpected response code: 200 .

I have left everything the same except that I use @HttpContext.Current.Request.ServerVariables["HTTP_HOST"] to connect to the server on the client side since different servers will be used in Azure, I have tried this in a local app and it worked. I still have not deployed to Azure but am testing locally, maybe the server is not actually running, how can I check this? Using breakpoints it seems that the necessary methods to start the server are being entered.

  • 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-18T19:01:35+00:00Added an answer on June 18, 2026 at 7:01 pm

    I suggest you take the code from your console application and move it to the WebRole.cs of your Cloud Service. This file is the entry point of your instance meaning your code will run when the instance starts. This will allow you to run the WebSocket server together with your ASP.NET MVC application in the same role.

    So in Visual Studio you’ll need to create a new Cloud Service and choose an MVC4 Web Role.

    public class WebRole : RoleEntryPoint
    {
        public override bool OnStart()
        {
            Task.Factory.StartNew(OnStartWebSocketServer, TaskCreationOptions.LongRunning);
            return base.OnStart();
        }
    
        private void OnStartWebSocketServer()
        {
            var aServer = new WebSocketServer(81, IPAddress.Any)
            {
                OnReceive = OnReceive,
                OnSend = OnSend,
                OnConnect = OnConnect,
                OnConnected = OnConnected,
                OnDisconnect = OnDisconnect,
                TimeOut = new TimeSpan(0, 5, 0)
            };
            aServer.Start();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created my web socket server and client using this simple tutorial here
I have created application which is accessing alfresco using web service client. Now I
I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which
I have a simple web application in which I have created a wizard, each
I am developing a simple forum web application using SpringMVC, JPA2. I have created
I have created a simple web application, for which I want all responses with
I have created a very simple ASP.NET application with a web.config file, which contains
Could someone help me on this, I have created simple web services using axis2
I have created a simple web browser using c# and I want to block
I have created a simple web-service using Java. i want to load jars related

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.