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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:58:30+00:00 2026-06-14T19:58:30+00:00

I followed the instructions on creating a custom scaffolder using the T4 Scaffolding package

  • 0

I followed the instructions on creating a custom scaffolder using the T4 Scaffolding package and they worked great. However, in the process I found out that I need to build a lot of reusable components that will be shared across multiple scaffolders and templates.

I know I can build a class library and register it in the GAC to make it accessible to the powershell scripts and T4 templates, but in a team environment, that is not always possible. I’d prefer to check-in the reusable components to source control and make them accessible somehow.

One approach I took was to split the T4 templates into multiple files and include all of them into the master template.

<#@ include file="Extensions.cs.t4" #>

However, if I define a class in any one of the templates, the class becomes a nested class and therefore can not be static (for example).

Is there a way to build re-usable classes, methods, extensions and make them accessible to custom scaffolders without installing them to the GAC? The T4Scaffolding package has a number of utility functions accessible in the custom scaffolder. How did they do it?

  • 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-14T19:58:31+00:00Added an answer on June 14, 2026 at 7:58 pm

    I think I figured it out with the help of this answer. I have to build an assembly with all my shared code. Then, in the Powershell script, I just have to:

    import-module "d:\path\to\assembly.dll"
    

    Hope that helps someone. And if anyone has a better idea, please share.

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

Sidebar

Related Questions

I have followed the instructions on http://railscasts.com/episodes/147-sortable-lists for creating a sortable list. The list
I am trying to do ssh connection using cygwin. I have followed instructions given
I followed the instructions given in the link: http://blog.avirtualhome.com/how-to-compile-a-new-ubuntu-11-04-natty-kernel/ for building a custom kernel
[Refer to https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers] I followed instructions for creating a GMap sidebar. This is not
I followed the instructions titled Creating your first app to get my first app
I followed instructions on http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ and succesfully inserted sqlite database on android device so
I'm wanting to create a remote NuGet server. I've followed the instructions here: http://docs.nuget.org/docs/creating-packages/hosting-your-own-nuget-feeds
i have followed instructions found on https://github.com/coderifous/jquery-localize , and for testing purpose i have
I have followed the Accepted Answer's instructions from this post as regards creating a
I've followed instructions from this question on SO to set up RVM, rubies and

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.