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 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 watching the Google clean code video on YouTube (see link ,
Just finished read this post by Greg Young, where he is talking about Microsoft
I just finished a small project where changes were required to a pre-compiled, but
I just finished a medium sized web site and one thing I noticed about
I just finished a test as part of a job interview, and one question
I just finished a 2d platformer in C++/Allegro. Its still in an incomplete stage...
I just finished setting up an out-of-place build system for our existing C++ code
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I just finished reading this article on the advantages and disadvantages of exceptions and
I just finished transferring as much link-structure data concerning wikipedia (English) as I could.

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.