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

  • Home
  • SEARCH
  • 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 911041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:08:14+00:00 2026-05-15T17:08:14+00:00

I just finished creating T4 templates to auto-generate property implementations for my ViewModel classes

  • 0

I just finished creating T4 templates to auto-generate property implementations for my ViewModel classes (see here: Automatic INotifyPropertyChanged Implementation through T4 code generation?).

Currently I need to have the project holding the “.tt”-files in the solution where I want to generate the property implementations.

So the solution for example contains three projects: T4Generation, SomeProjectWithViewModels, AnotherProjectWithViewModels.

Then when invoking the T4-template in T4Generation it looks through all of the projects in the solution and finds all of the ViewModel classes and generates a C# file containing property implementations for the specific ViewModel in the respective project.

Example:

“SomeProjectWithViewModels.SomeViewModel.cs”

public partial class SomeViewModel : BaseViewModel
{
    private string p_SomeProperty;
}

generates a file “SomeProjectWithViewModels.SomeViewModel.Properties.cs”

public partial class SomeViewModel
{
    public string SomeProperty
    {
        get { ... }
        set { ... }
    }
}

The question I now have if there is any possibility to create a assembly (ie “T4Generation.dll”) that can be referenced in any solution enabling the host solution to invoke the code generation process somehow.

For example I would start a new solution “SomeSolution.sln” with projects “SomeApplication.exe”, “SomeClassLibrary.dll” and in SomeApplication I would reference “T4Generation.dll” and during the build process of SomeApplication the T4 generation would be invoked.

Is this possible?

  • 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-05-15T17:08:15+00:00Added an answer on May 15, 2026 at 5:08 pm

    Are you using Visual Studio 2010? If so, I’d recommend using the “Preprocessed Templates” for what you’re trying to do. Preprocessed templates make a generator class that generates your code, instead of generating your code directly. So, with these generator classes made from your T4 templates, you can make a T4Generation.EXE console app that gets called from your projects as a pre-compile command. Pass in the path to the project, and the generators should do the rest. This will then be re-usable from any project.

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

Sidebar

Related Questions

I just finished creating my first major application in C#/Silverlight. In the end the
I'm in part four of the MvcMusicStore tutorial . I just finished creating my
I just finished creating a new user for my database in SQL Server. I
I'm creating a new rails app for my business, and I just finished a
I have just finished creating my signup form and now ready to insert data
I have just finished creating a game of life simulation for c# and found
I just finished creating a Point class and was working on a Line class
I have just finished creating a custom role provider using LINQ to SQL for
I have just finished my latest task of creating an RSS Feed using PHP
I just finished this exercise for beginners on creating and importing modules in python.

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.