What is the SVC file format?
Text files with the .svc extension contain a service activation instruction for WCF - Windows Communication Foundation. A single .svc file holds a @ServiceHost directive specific to WCF data processing that is run by Microsoft IIS. Services hosted on machines can be activated this way via incoming messages. .svc files can be opened and edited in any text editor, but Microsoft Visual Studio and similar IDEs are commonly used instead.
The @ServiceHost directive supports several attributes. The core Service attribute holds the name of the CLR (Common Language Runtime) service implementation, responsible for creating an instance on the host dynamically upon initial request. Additional attributes can refer to the Language in which the service is implemented, Debug settings, a CodeBehind source code path, or a custom Factory class. Additionally, .svc files can contain inline service code. Any edits made to files require recompilation upon the next query.
When hosting a service in IIS, endpoint addresses are always relative to the .svc file path. For example, if the base WCF service address is http://localhost/Application/Service.svc and the web.config file contains <endpoint address="point" />, then http://localhost/Application/Service.svc/point refers to that endpoint. Browsing the .svc URL directly shows a service help page with a link to the WSDL contract (?wsdl).
WCF is a legacy technology not included in modern .NET (Core/5+). It superseded the older .asmx format for enterprise service hosting. Projects migrating away from .svc-based services can target ASP.NET Core minimal APIs, gRPC, or the community-maintained CoreWCF library as a compatibility bridge.
Security & safety
RISK: LOWThe .svc file itself is harmless plain text and contains no executable code (the logic lives in compiled DLLs). Security concerns are server-side and about the SERVICE, not the file: an exposed WCF endpoint should use proper bindings/authentication, and leaving the WSDL/metadata publicly browsable can reveal the service contract. As a user, a stray .svc file you find is inert - there's nothing to execute by opening it.
Format details
in a nutshellPrograms that open SVC files
Technical details
deep spec| File type | Plain-text service activation file - no binary content, no data payload of its own |
| Text encoding | UTF-8 |
| Directive syntax | ASP.NET page-directive syntax: `<%@ ServiceHost ... %>` |
| MIME type | `text/plain` |
| Typical file size | Under 1 KB - usually a single directive line |
| Host environment | Microsoft IIS via the ASP.NET WCF handler (`svc-Integrated` or `svc-ISAPI` HTTP handler) |
| Service attribute | Names the CLR class that implements the WCF service (e.g., `MyNamespace.MyService`) |
| Factory attribute | Optional; specifies a custom `ServiceHostFactory` class to control how the service host is constructed |
| Inline code support | Service implementation code may be placed directly inside the `.svc` file alongside the directive |
| Endpoint URL pattern | The `.svc` file URL is the service base address; sub-paths extend it (e.g., `/Service.svc/methodName`) |
| WSDL exposure | Appending `?wsdl` to the `.svc` URL returns the auto-generated WSDL contract document for the service |
| Business logic location | Compiled into a `.dll` assembly in the web application's `bin` directory; `.svc` is the IIS entry point only |
| Runtime configuration | Bindings, endpoints, and behaviors are declared in `web.config`, not inside the `.svc` file |
| File identification | No magic bytes; identified by the `<%@ ServiceHost` directive at or near the start of the file |
| Predecessor format | `.asmx` (ASMX Web Services) - WCF's `.svc` superseded ASMX for enterprise and cross-platform service hosting |
| Legacy status | WCF is absent from .NET Core/5+; the community CoreWCF project offers a migration path for existing `.svc`-based services |
| Released | 2006 (Windows Communication Foundation, .NET Framework 3.0) |
| Latest version | Tied to WCF on .NET Framework; WCF is not in modern .NET (Core/5+) - see CoreWCF |
| Specification | learn.microsoft.com |
SVC conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about SVC files.