{"id":20014,"date":"2016-08-10T21:03:28","date_gmt":"2016-08-11T05:03:28","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=20014"},"modified":"2017-12-07T20:58:52","modified_gmt":"2017-12-07T17:58:52","slug":"how-to-get-started-with-asp-net-and-websocket-on-ge-predix","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/","title":{"rendered":"How to Get Started with ASP.NET and WebSocket on GE Predix"},"content":{"rendered":"<p><a href=\"https:\/\/www.altoros.com\/blog\/deploying-an-asp-net-application-to-ge-predix\/\">Our previous article<\/a> focused on deploying a simple ASP.NET app to Predix. From this post, learn about deploying an ASP.NET Core 1.0 application that employs the WebSocket protocol.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#Preparing_the_application_for_Predix\" >Preparing the application for Predix<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#Deploying_the_application_to_Predix\" >Deploying the application to Predix<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#Related_reading\" >Related reading<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To follow the steps of this tutorial, you need:<\/p>\n<ul>\n<li><a href=\"https:\/\/login.system.aws-usw02-pr.ice.predix.io\/login\" target=\"_blank\">A Predix account<\/a><\/li>\n<li>Microsoft Visual Studio 2015<\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-core-1-0\/\" target=\"_blank\">Microsoft .NET Core 1.0<\/a><\/li>\n<li>The Cloud Foundry CLI<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Preparing_the_application_for_Predix\"><\/span>Preparing the application for Predix<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The initial plan was to create an ASP.NET application with SignalR and then deploy it to Predix. Unfortunately, SignalR <a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/wiki\/\" target=\"_blank\">is not included<\/a> in the ASP.NET Core 1.0.0 version, so we used the native WebSocket support instead\u2014Microsoft.AspNetCore.WebSockets.Server.<\/p>\n<p>To implement your ASP.NET application and make it ready for deployment to Predix:<\/p>\n<ol>\n<li style=\"margin-bottom: 10px;\">Go to Microsoft Visual Studio 2015 and create a new project using a standard ASP.NET 5 template.<\/li>\n<li style=\"margin-bottom: 10px;\">Compile and start the application to check if it works locally.<\/li>\n<li style=\"margin-bottom: 10px;\">Prepare the back-end part using the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Startup.cs<\/code> file:\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">public void Configure(IApplicationBuilder app)\r\n{\r\n    app.UseDeveloperExceptionPage();\r\n    app.UseDefaultFiles();\r\n    app.UseStaticFiles();\r\n    app.UseWebSockets();\r\n    app.Use(async (http, next) =&gt;\r\n    {\r\n        if (http.WebSockets.IsWebSocketRequest)\r\n        {\r\n            var webSocket = await http.WebSockets.AcceptWebSocketAsync();\r\n        while (webSocket.State == WebSocketState.Open)\r\n            {\r\n                var token = CancellationToken.None;\r\n                var buffer = new ArraySegment&lt;byte&gt;(new byte&#x5B;4096]);\r\n                var received = await webSocket.ReceiveAsync(buffer, token);\r\n                switch (received.MessageType)\r\n                {\r\n                    case WebSocketMessageType.Text:\r\n                        var request = Encoding.UTF8.GetString(buffer.Array, buffer.Offset, buffer.Count);\r\n                        var type = WebSocketMessageType.Text;\r\n                        var data = Encoding.UTF8.GetBytes(string.Format(&quot;Server: {0}&quot;, request));\r\n                        buffer = new ArraySegment&lt;byte&gt;(data);\r\n                        await webSocket.SendAsync(buffer, type, true, token);\r\n                        break;\r\n                }\r\n            }\r\n        }\r\n        else\r\n        {\r\n            await next();\r\n        }\r\n    });\r\n}\r\n<\/pre>\n<\/li>\n<li style=\"margin-bottom: 10px;\">Add MVC support:\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">public void Configure(IApplicationBuilder app)\r\n{\r\n    ...\r\n    app.UseMvc(routes =&gt;\r\n    {\r\n        routes.MapRoute(\r\n          name: &quot;default&quot;,\r\n          template: &quot;{controller=Home}\/{action=Index}\/{id?}&quot;);\r\n        });\r\n    }\r\n}\r\npublic void ConfigureServices(IServiceCollection services)\r\n{\r\n    services.AddMvc();\r\n}\r\n<\/pre>\n<\/li>\n<li style=\"margin-bottom: 10px;\">Additionally, create a simple controller:\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">public class HomeController : Controller\r\n{\r\n    public IActionResult Index()\r\n    {\r\n        return new EmptyResult();\r\n    }\r\n}\r\n<\/pre>\n<\/li>\n<li style=\"margin-bottom: 10px;\">Prepare the front-end part:\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;script type=&quot;text\/javascript&quot;&gt;\r\n    var webSocket;\r\n    $(document).ready(function () {\r\n        webSocket = new WebSocket('wss:\/\/&lt;predix URL&gt;\/Home\/Index');\r\n        webSocket.onopen = function () {\r\n            $('#status').text('connected');\r\n        };\r\n        webSocket.onmessage = function (evt) {\r\n            $('#messages').append('&lt;li&gt;' + evt.data + '&lt;\/li&gt;');\r\n        };\r\n        webSocket.onerror = function (evt) {\r\n            alert(evt.message);\r\n        };\r\n        webSocket.onclose = function () {\r\n            $('#status').text('disconnected');\r\n        };\r\n        $('#btnSend').click(function () {\r\n            if (webSocket.readyState == WebSocket.OPEN) {\r\n                webSocket.send($('#textInput').val());\r\n            }\r\n            else {\r\n                $('#status').text('Connection is closed');\r\n            }\r\n        });\r\n    });\r\n&lt;\/script&gt;<\/pre>\n<p>Here is how the form looks like:<\/p>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/aspnet-app-on-ge-predix.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/aspnet-app-on-ge-predix.png\" alt=\"aspnet-app-on-ge-predix\" width=\"423\" height=\"338\" class=\"aligncenter size-full wp-image-20079\" \/><\/a><\/li>\n<li style=\"margin-bottom: 10px;\">Before deploying the application in Predix, modify the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">project.json<\/code> file:\n<ul style=\"list-style-type: lower-alpha\">\n<li style=\"margin-bottom: 10px;\">Include the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Microsoft.AspNet.Server.Kestrel<\/code> dependency and the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">kestrel<\/code> command.<\/li>\n<li style=\"margin-bottom: 10px;\">Make sure your application targets the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">dnxcode50<\/code> framework.<\/li>\n<\/ul>\n<p>These changes help Predix to select the correct buildpack for the application. Here is how the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">project.json<\/code> file should look like:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&quot;dependencies&quot;: {\r\n    &quot;Microsoft.NETCore.App&quot;: {\r\n            &quot;version&quot;: &quot;1.0.0&quot;,\r\n            &quot;type&quot;: &quot;platform&quot;\r\n    },\r\n    ...\r\n},\r\n&quot;frameworks&quot;: {\r\n    &quot;netcoreapp1.0&quot;: {\r\n        &quot;imports&quot;: &#x5B;\r\n            &quot;dotnet5.6&quot;,\r\n                &quot;portable-net45+win8&quot;\r\n        ]\r\n    }\r\n},\r\n...\r\n<\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Deploying_the_application_to_Predix\"><\/span>Deploying the application to Predix<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>After finishing the necessary preparations, you can deploy the application to Predix.<\/p>\n<p>With the Cloud Foundry command line interface installed, go through these steps:<\/p>\n<ol>\n<li style=\"margin-bottom: 10px;\">\n<p>Open <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cmd.exe<\/code> and change to your ASP.NET directory:<\/p>\n<pre style=\"padding-left: 20px;\"><code>cd &lt;folder where project.json is located&gt;<\/code><\/pre>\n<\/li>\n<li style=\"margin-bottom: 10px;\">\n<p>Log in to your Predix account:<\/p>\n<pre style=\"padding-left: 20px;\"><code>cf login -a &lt;API endpoint&gt; -u &lt;your predix email&gt; -o &lt;your predix organization&gt; -s &lt;your predix space&gt;<\/code><\/pre>\n<\/li>\n<li style=\"margin-bottom: 10px;\">\n<p>After logging in, push the application:<\/p>\n<pre style=\"padding-left: 20px;\"><code>cf push testaspnetcore -b https:\/\/github.com\/cloudfoundry-community\/dotnet-core-buildpack<\/code><\/pre>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/deploying-aspnet-app-on-ge-predix.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/deploying-aspnet-app-on-ge-predix.png\" alt=\"deploying-aspnet-app-on-ge-predix\" width=\"640\" class=\"aligncenter size-full wp-image-20081\" \/><\/a><\/p>\n<p>Now, you can see the result in the browser.<\/p>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/aspnet-websocket-on-ge-predix.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/aspnet-websocket-on-ge-predix.png\" alt=\"aspnet-websocket-on-ge-predix\" width=\"638\" height=\"395\" class=\"aligncenter size-full wp-image-20080\" \/><\/a><\/p>\n<p>The source code for the tutorial is available <a href=\"https:\/\/github.com\/Altoros\/Predix.Net-Websockets\" target=\"_blank\">on GitHub<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>At the moment, SignalR is not yet supported in .NET Core 1.0. The good news is that the native WebSocket implementation\u2014Microsoft.AspNetCore.WebSockets.Server\u2014works perfectly on .NET Core 1.0, and no additional steps are required for running applications that use the WebSocket protocol on Predix.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Related_reading\"><\/span>Related reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/deploying-an-asp-net-application-to-ge-predix\/\">Deploying an ASP.NET Application to GE Predix<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/using-the-postgresql-service-in-an-asp-net-app-on-ge-predix\/\">Using the PostgreSQL Service in an ASP.NET App on GE Predix<\/a><\/li>\n<\/ul>\n<hr\/>\n<p><center><small>This post was written by <a href=\"https:\/\/www.altoros.com\/blog\/author\/e-lahansky\/\">Eugene Lahansky<\/a> and edited by <a href=\"https:\/\/www.altoros.com\/blog\/author\/viktoryia-fedzkovich\/\" target=\"_blank\">Victoria Fedzkovich<\/a>.<\/small><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our previous article focused on deploying a simple ASP.NET app to Predix. From this post, learn about deploying an ASP.NET Core 1.0 application that employs the WebSocket protocol.<\/p>\n<p>&nbsp;<\/p>\n<p>Prerequisites<\/p>\n<p>To follow the steps of this tutorial, you need:<\/p>\n<p>A Predix account<br \/>\nMicrosoft Visual Studio 2015<br \/>\nMicrosoft .NET Core 1.0<br \/>\nThe Cloud Foundry CLI<\/p>\n<p>&nbsp;<\/p>\n<p>Preparing the application for [&#8230;]<\/p>\n","protected":false},"author":103,"featured_media":29562,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[873,117,647],"class_list":["post-20014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cloud-native","tag-iot","tag-predix"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Get Started with ASP.NET and WebSocket on GE Predix | Altoros<\/title>\n<meta name=\"description\" content=\"Here, we continue to explore how to use Predix, GE\u2019s platform for the Internet of Things, for creating .NET apps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Get Started with ASP.NET and WebSocket on GE Predix | Altoros\" \/>\n<meta property=\"og:description\" content=\"Our previous article focused on deploying a simple ASP.NET app to Predix. From this post, learn about deploying an ASP.NET Core 1.0 application that employs the WebSocket protocol. &nbsp; Prerequisites To follow the steps of this tutorial, you need: A Predix account Microsoft Visual Studio 2015 Microsoft .NET Core 1.0 The Cloud Foundry CLI &nbsp; Preparing the application for [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-11T05:03:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-07T17:58:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Eugene Lahansky\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eugene Lahansky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/\",\"name\":\"How to Get Started with ASP.NET and WebSocket on GE Predix | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif\",\"datePublished\":\"2016-08-11T05:03:28+00:00\",\"dateModified\":\"2017-12-07T17:58:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/41eafcad445ed8378c19eaaf9612668d\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif\",\"width\":640,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Get Started with ASP.NET and WebSocket on GE Predix\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/41eafcad445ed8378c19eaaf9612668d\",\"name\":\"Eugene Lahansky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Lahanskiy.Evgeniy.jpg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Lahanskiy.Evgeniy.jpg\",\"caption\":\"Eugene Lahansky\"},\"description\":\"Eugene Lahansky is a Solutions Architect at Altoros. With his extensive experience in .NET programming, he designs and develops web-based software for Windows platforms. Eugene also works with the UNIX stack of technologies, including NGINX, Docker, and Node.js.\",\"url\":\"https:\/\/www.altoros.com\/blog\/author\/e-lahansky\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Get Started with ASP.NET and WebSocket on GE Predix | Altoros","description":"Here, we continue to explore how to use Predix, GE\u2019s platform for the Internet of Things, for creating .NET apps.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/","og_locale":"en_US","og_type":"article","og_title":"How to Get Started with ASP.NET and WebSocket on GE Predix | Altoros","og_description":"Our previous article focused on deploying a simple ASP.NET app to Predix. From this post, learn about deploying an ASP.NET Core 1.0 application that employs the WebSocket protocol. &nbsp; Prerequisites To follow the steps of this tutorial, you need: A Predix account Microsoft Visual Studio 2015 Microsoft .NET Core 1.0 The Cloud Foundry CLI &nbsp; Preparing the application for [...]","og_url":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/","og_site_name":"Altoros","article_published_time":"2016-08-11T05:03:28+00:00","article_modified_time":"2017-12-07T17:58:52+00:00","og_image":[{"width":640,"height":400,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif","type":"image\/gif"}],"author":"Eugene Lahansky","twitter_misc":{"Written by":"Eugene Lahansky","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/","url":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/","name":"How to Get Started with ASP.NET and WebSocket on GE Predix | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif","datePublished":"2016-08-11T05:03:28+00:00","dateModified":"2017-12-07T17:58:52+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/41eafcad445ed8378c19eaaf9612668d"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/aspnet-app-on-ge-predix_v3.gif","width":640,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/how-to-get-started-with-asp-net-and-websocket-on-ge-predix\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Get Started with ASP.NET and WebSocket on GE Predix"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/41eafcad445ed8378c19eaaf9612668d","name":"Eugene Lahansky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Lahanskiy.Evgeniy.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Lahanskiy.Evgeniy.jpg","caption":"Eugene Lahansky"},"description":"Eugene Lahansky is a Solutions Architect at Altoros. With his extensive experience in .NET programming, he designs and develops web-based software for Windows platforms. Eugene also works with the UNIX stack of technologies, including NGINX, Docker, and Node.js.","url":"https:\/\/www.altoros.com\/blog\/author\/e-lahansky\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/20014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/103"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=20014"}],"version-history":[{"count":13,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/20014\/revisions"}],"predecessor-version":[{"id":29552,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/20014\/revisions\/29552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/29562"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=20014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=20014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=20014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}