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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:00:26+00:00 2026-06-03T22:00:26+00:00

In creating a WCF service (filetype .svc) in Visual Studio 2010, I’d like to

  • 0

In creating a WCF service (filetype .svc) in Visual Studio 2010, I’d like to make the C# code-behind file (.svc.cs) into a T4 file (.tt). How can I do this, if at all possible?

EDIT:
Note that I am writing the WCF service itself, not a client.

  • 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-03T22:00:29+00:00Added an answer on June 3, 2026 at 10:00 pm

    Updated answer based on clarification of question.

    If you want to template the service.svc.cs file do this:

    • Open the service.svc.cs file and save it as a .TT extension. This will cause the svc.cs file to automatically vanish (I assume because of the class defined in it).

    • Ensure the Build Action is set to “content”.

    • Ensure the custom build option of the service.svc.tt file is TextTemplatingFileGenerator.

    • Add the language type you want to use for your TT scripting to the top of the Reference.tt file (always good to be explicit):

      <#@ template language=”C#” #>

    • Click save while the .tt file is open, at any time, to (re)generate the output cs file.

    I have just tried and confirmed these steps work on a new WCF service project.

    Extra trick:

    As you’re using Visual Studio 2010, you can also change the custom tool on the template from TextTemplatingFileGenerator to TextTemplatingFilePreprocessor temporarily.

    This will spit out the underlying code directly into your project instead of the regular template output! Great for seeing what code is generated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Visual Studio 2010 when creating a wcf service the template creates a class
I'm creating a WCF service using Visual Web Developer Express 2010. I'd like to
When creating a new service in a WCF service project, Visual Studio will automatically
Creating a WCF Service Library in Visual Studio 2008 on Vista x64 is troublesome
I've had not a lot of luck creating a WCF service with Visual Studio.
I am having problems creating WCF client proxy for service code like in this
in the process of creating a WCF service I ran into a term that's
I'm creating a custom WCF service for deployment inside SharePoint 2010 following the instructions
We are creating a WCF service with a companion client DLL (.Net) that we
Currently I am creating a WCF service which has to connect to a DAL

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.