"You have created a service." How did this happen? - visual-studio

When I create a new "WCF Service Application" in Visual Studio and right-click Service1.svc, I can choose "View in Browser". A web browser appears showing http://localhost:50311/Service1.svc, which says
Service1 Service
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://localhost:50311/Service1.svc?wsdl
...
The service somehow seems tied to Visual Studio itself, since the web page becomes inaccessible if I close the solution. What's going on? I don't have a web server installed, and I didn't (knowingly) start the service. What is the source of the displayed web page, and why is it on port 50311? Can the page be customized?

What you're seeing is the development web server that starts when you run a debugger instance of a project that requires a web server. (WCF, ASP.NET).
The port 50311 is determined by your project settings (most likely random, but you can specify).
The page for a .svc file is not meant to be customized. Since the service is waiting for a caller, that default page simply tells you that it's running properly.
Keep in mind that WCF offers several binding options that use various protocols (HTTP, TCP). Depending on the protocol that you choose, you will have to host in either IIS, a Windows Service or elsewhere. By default, new services will adopt a binding that works in IIS.
Check out Introduction to Building Windows Communication Foundation Services

Related

TF15013: The requested Team Foundation Server is not registered with the proxy server

I have configured TFS Proxy server and have set the source control setting of my local VS client. Also TFS Application server & TFS Proxy server both are in same network Domain.
But when i am taking get latest of any team project and second time taking the get latest of same team project at different machine but files are downloading Main server and giving below warning.
TF15013: The requested Team Foundation Server is not registered with the proxy server.
Can Anyone help me out how to resolve this issue & make fast get latest.
Thanks,
You can try to use the proxy command to configure your client to use a proxy server: see Proxy Command
eg :
c:\projects>tf proxy /add http://server:8081 /default:global /collection:http://tfsserver:8080/
If that still not work, recommend you to reconfigure the Proxy, you must use service accounts to install Team Foundation Server, and Team Foundation Server Proxy. These service accounts become the identity for the installed component.
By default, every component uses a built-in account (such as Network Service) as its service account.Built-in accounts do not use passwords and already have the Log on as a service permission, making them easier to manage, especially in a domain environment. See requirements.
After that you can reference below link to configure the TFS proxy to work with Your TFS:
https://blogs.msdn.microsoft.com/buckh/2016/10/12/how-to-configure-a-tfs-proxy-to-work-with-team-services/
Update:
TFS 2013 is Xaml build system, double chick the definition will pop up the definition to edit. TFS 2017 is vNext build system, it will redirect to web client build progress page. That's by design, not related to the source settings.
And as far as I know, there isn't the utility or third part tools can open the vNext build definition in VS directly, vNext build definition is task independent, you can edit it conveniently via web portal.

Service Fabric hosted Web API

I've created a simple Stateful Actor and a Web API (self hosted) and deployed it to Azure. It has worked and I can browse the nodes in the Service Fabric Explorer.
Azure gives me a url but when I add /api/values to the end (which works fine locally) it downloads a file called values and I can't open it as it is a binary file.
I want to call the web api from a Xamarin app (ie normal Rest api call) but if I can't call it via a browser I'm a bit stuck.
I would comment this on Stephen's answer, but I lack sufficient reputation.
To add a custom port to the Load Balancer after the service fabric cluster has been created you can (in the newer Azure portal):
Navigate to the load balancer resource for your service fabric cluster.
Under "Settings" find the "Load balancing rules" option.
This will have at least two rules, more if you did setup custom rules during the setup of the cluster.
Add a new rule.
Give it a name
'Port' is the external port you'd like to hit.
'BackendPort' is the port your service is configured to listen on.
The defaults on the other settings work in a pinch.
Note if you have multiple ports to enable, they each need their own rule.
I do know the above worked in my 'hello world' sandbox project.
I'm climbing the service fabric learning curve myself so I can't comment with authority on the other settings.
Have discovered what was missing.
https://azure.microsoft.com/en-us/documentation/articles/service-fabric-cluster-creation-via-portal/
This link here walks through creating the Service Fabric app on Azure and in particular the field "Application input endpoints" needs to have the port you want to use. For the samples, they are mostly port 80 or 8081.
There is supposed to be a way to add these ports afterwards which I tried (and so did a Microsoft support engineer) and it did not seem to work. You are supposed to be able to add these ports to the Load Balancer associated with the Service Fabric App.
I recreated my Service Fabric app, exactly as I did before but this time filled in the ports I want to use in the Node Type section and now I can hit the webapi services I've deployed. This field can be left blank which is what I did first time round and was why I had issues.
Not really related to Service Fabric, it's just how you set up your HTTP response headers in Web API. Recommend tagging this with asp.net or asp.net-web-api for a more thorough answer.
Tutorials and technical resources around Azure Service Fabric Stateless Web API tend to be slightly disjointed, given that the platform and resources are still quite immature.
This Stateless Web API tutorial, at the time of writing, is very effective.
As prerequisite to the tutorial:
Update Visual Studio to the latest version (Extensions and Updates)
Update the Service Fabric SDK to the latest version (Web Platform Installer)
Explicitly specify the EndPoint Port attribute (defined in ServiceManifest.xml) when setting up your Azure Service Fabric Cluster Node Type parameters
Following these steps will successfully allow deployment to both local and remote clusters, and will expose your Web API endpoints for consumption.

Is omnisharp Server similar to IIS express

Is omnisharp server similar to IIS express? Let's say I have a project folder which has only html files, I start the ominisharp server through atom text editor. It gets started and says listening at port xxxx
If I browse localhost://xxxx/index.html will it serve that file?
I am newbie please clarify
No, the point of the Omnisharp server is not to be a general purpose web server - it's to act as a service. Think of it as an "IDE service" that just happens to exposed itself over HTTP, as that's the easiest way for many clients to talk to a service.
Unless you need to integrate something with Omnisharp yourself (i.e. writing code to be a client), you can probably just think of it as a plugin for whatever you're using. (In most cases there will be an actual plugin, which then talks to Omnisharp.)

Using the Microsoft StreamInsight Event Flow Debugger with an In-Process Host

I'm trying connect to an in-process StreamInsight host running in Visual Studio (as opposed to the windows service version) using the Event Flow Debugger tool, and I have been unsuccessful.
Does anyone have experience with this? I'm looking at the following blog posts:
End to end StreamInsight example: http://blogs.msdn.com/b/masimms/archive/2010/08/10/building-your-first-end-to-end-streaminsight-application.aspx
In-process vs. Standalone Host deployment models: http://seroter.wordpress.com/2010/06/27/leveraging-and-managing-the-streaminsight-standalone-host/
You need to explicitly open up a WCF management service endpoint for any embedded StreamInsight host. You can choose any URL that you have permission to create. Once you start up your embedded server with the management point host opened, you can connect the Event Flow Debugger to the URL chosen.
For the standalone host, there is an entry in the StreamInsight.exe.config file that holds the management service endpoint URL used by the standalone Windows Service. This host is automatically opened when you start the Windows Service associated with the instance.

How can I get Visual Studio Web Development Server (Cassini) to send the domain name of the request to the web application?

We're developing an application that is sensitive to the domain name of the request. The problem we're running into is that we have to use IIS in order to test the application because Cassini will only send "localhost" as the requested domain despite using a different domain in the address bar. While IIS does give us better performance than Cassini, we would still like to be able to hit F5 to run our application from within Visual Studio.
Is there any configuration that can be done to specify the domain name to use in Cassini?
I just released the CassiniDev 3.5.1/4.0.1 beta with a simple test fixture example if you are interested.
It supports arbitrary IP addresses and host names. Should fit your needs quite nicely.
http://cassinidev.codeplex.com

Resources