I have a file with an .svc extension. First question is what is a .svc file? The second question is how do I create one of these from the Visual Studio add item menu? I've tried all the most obvious options but none of them create a .svc file.
Asked
Active
Viewed 5.0k times
2 Answers
24
In my experience, an SVC file is a WCF service - create a WCF application from the projects list and then do an "Add new item" and add a new WCF service.
For it to do anything it will need the appropriate bindings and endpoints configuring and wiring up - before it can be called.
See also: WCF service. Where to add . svc file

Community
- 1
- 1

SpaceBison
- 3,704
- 1
- 30
- 44
17
Q1: what is a SVC file ?
A1: A class for creating a WCF service.
Q2: how do I create one from the VS Add New Item menu ?
A2: I'm assuming you're working with C# here but that's just a detail.
- Go to Add New Item
- Look for the node that says Web and click it (make sure you haven't selected one of the sub nodes!)
- In the middle column look for WCF Service
- That's all there is to it ;-)

Captain Sensible
- 4,946
- 4
- 36
- 46
-
Unfortunately, that template does not exist in my VS. It jumps from "TypeScript JSX File" to "Web Configuration File". Copying an existing service, renaming and rewriting the guts doesn't work either, because what ever code is behind it still thinks its the old service. I've cleaned, and rebuilt, all to no avail. I am now going to go stand in traffic. Thank you M$. – ARLibertarian Aug 25 '22 at 15:45
-
OK, it was dropped from VS2019. I have to re-run the install as specifically add it. "It looks like you don't have the "Windows Communication Foundation" component installed. Please run the Visual Studio installer and add this component under Individual Components if you need the WCF templates. In Visual Studio 2017 this component was included by default in the web workload, but is now optional in VS 2019 so you have to check the box when installing." – ARLibertarian Aug 25 '22 at 15:49